Symbolic shape inference: fix rank for ConstantOfShape (#5912)

This commit is contained in:
KeDengMS 2020-11-24 14:50:41 -08:00 committed by GitHub
parent c2d610066a
commit ee908eb0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -623,7 +623,8 @@ class SymbolicShapeInference:
self.sympy_data_[node.output[0]] = np.ones([int(x) for x in sympy_shape], dtype=np.int64) * numpy_helper.to_array(get_attribute(node, 'value', 0))
else:
# create new dynamic shape
sympy_shape = self._new_symbolic_shape(self._get_shape_rank(node,0), node)
# note input0 is a 1D vector of shape, the new symbolic shape has the rank of the shape vector length
sympy_shape = self._new_symbolic_shape(self._get_shape(node,0)[0], node)
vi.CopyFrom(helper.make_tensor_value_info(node.output[0],
vi.type.tensor_type.elem_type,