From 43e389d7c703b7c393ff12827121f869b1a1e472 Mon Sep 17 00:00:00 2001 From: Frank Seide Date: Tue, 12 Feb 2019 13:55:54 -0800 Subject: bug fix: reshape() must verify that #elements does not change; bug fix: beam search must reshape first step correctly --- src/graph/node_operators_unary.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/graph/node_operators_unary.h') 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; } -- cgit v1.2.3