diff options
author | Frank Seide <fseide@microsoft.com> | 2019-06-21 04:58:32 +0300 |
---|---|---|
committer | Frank Seide <fseide@microsoft.com> | 2019-06-21 04:58:32 +0300 |
commit | 3914032c9a4eca62f4449b383ea7d9220b096f65 (patch) | |
tree | f3f52ec53efe18f4e4954f02b233610840c70ee2 /src/graph | |
parent | 1d80793b358d3a30126e69f892053a0a47181590 (diff) |
workaround for a segfault
Diffstat (limited to 'src/graph')
-rwxr-xr-x[-rw-r--r--] | src/graph/node_operators_unary.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h index 36273d6f..94200435 100644..100755 --- a/src/graph/node_operators_unary.h +++ b/src/graph/node_operators_unary.h @@ -477,6 +477,10 @@ struct ReduceNodeOp : public UnaryNodeOp { NodeOps backwardOps() override { using namespace functional; +#if 1 // @BUGBUG: This is a workaround for not correctly propagating non-trainable information. @TODO: Do this the right and general way. + if (adj_ == nullptr) + return {}; +#endif switch (opCode_) { case ReduceNodeOpCode::sum: return {NodeOp(Add(_1, child(0)->grad(), adj_))}; |