Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/graph
diff options
context:
space:
mode:
authorFrank Seide <fseide@microsoft.com>2019-06-21 04:58:32 +0300
committerFrank Seide <fseide@microsoft.com>2019-06-21 04:58:32 +0300
commit3914032c9a4eca62f4449b383ea7d9220b096f65 (patch)
treef3f52ec53efe18f4e4954f02b233610840c70ee2 /src/graph
parent1d80793b358d3a30126e69f892053a0a47181590 (diff)
workaround for a segfault
Diffstat (limited to 'src/graph')
-rwxr-xr-x[-rw-r--r--]src/graph/node_operators_unary.h4
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_))};