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
diff options
context:
space:
mode:
authorFrank Seide <fseide@microsoft.com>2019-02-13 00:55:54 +0300
committerFrank Seide <fseide@microsoft.com>2019-02-13 00:55:54 +0300
commit43e389d7c703b7c393ff12827121f869b1a1e472 (patch)
tree9a0c99a2b146644ebdf22666b54b3a05cf5ef704 /src/graph/node_operators_unary.h
parent699e48700d43104ce62894aadd211838fb648e62 (diff)
bug fix: reshape() must verify that #elements does not change; bug fix: beam search must reshape first step correctly
Diffstat (limited to 'src/graph/node_operators_unary.h')
-rwxr-xr-xsrc/graph/node_operators_unary.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/graph/node_operators_unary.h b/src/graph/node_operators_unary.h
index 190fa947..c5141092 100755
--- a/src/graph/node_operators_unary.h
+++ b/src/graph/node_operators_unary.h
@@ -717,6 +717,8 @@ private:
public:
ReshapeNodeOp(Expr a, Shape shape) : UnaryNodeOp(a, shape, a->value_type()), reshapee_(a) {
+ ABORT_IF(a->shape().elements() != shape.elements(),
+ "Reshape must not change the number of elements (from {} to {})", a->shape().toString(), shape.toString());
Node::destroy_ = false;
}