diff options
author | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2017-10-29 17:42:01 +0300 |
---|---|---|
committer | Marcin Junczys-Dowmunt <junczys@amu.edu.pl> | 2017-10-29 17:42:01 +0300 |
commit | bc95140cfb7afc51fa104f4ecab3e5453bd706ef (patch) | |
tree | 8d57999c8c556cae36d7b9f8c992826cd0804445 /src/graph/node_operators_unary.h | |
parent | 2e16934080d4bf41d0ab7557836732bedb635efd (diff) | |
parent | 46433253735e79e03613fcbd28e64ff393f72451 (diff) |
merge rnn_test.cpp
Diffstat (limited to 'src/graph/node_operators_unary.h')
-rw-r--r-- | src/graph/node_operators_unary.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h index 9881357c..a3f60366 100644 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -146,8 +146,8 @@ struct TanhNodeOp : public NaryNodeOp { for(int n = 1; n < nodes.size(); ++n) { Shape shapen = nodes[n]->shape(); for(int i = 0; i < shapen.size(); ++i) { - UTIL_THROW_IF2(shape[i] != shapen[i] && shape[i] != 1 && shapen[i] != 1, - "Shapes cannot be broadcasted"); + ABORT_IF(shape[i] != shapen[i] && shape[i] != 1 && shapen[i] != 1, + "Shapes cannot be broadcasted"); shape.set(i, std::max(shape[i], shapen[i])); } } @@ -237,8 +237,11 @@ struct SwishNodeOp : public UnaryNodeOp { } NodeOps backwardOps() { - return {NodeOp( - Add(_1 * (_3 + Sigma(_2) * (1.f - _3)), child(0)->grad(), adj_, child(0)->val(), val_))}; + return {NodeOp(Add(_1 * (_3 + Sigma(_2) * (1.f - _3)), + child(0)->grad(), + adj_, + child(0)->val(), + val_))}; } const std::string type() { return "swish"; } |