!7289 [Revert Code]Revert python code in array_ops.py

Merge pull request !7289 from caifubi/dynamic_shape
This commit is contained in:
mindspore-ci-bot 2020-10-14 17:40:52 +08:00 committed by Gitee
commit 4f446bba83
1 changed files with 8 additions and 1 deletions

View File

@ -431,7 +431,7 @@ class Reshape(PrimitiveWithInfer):
return out
class Shape(Primitive):
class Shape(PrimitiveWithInfer):
"""
Returns the shape of input tensor.
@ -453,6 +453,13 @@ class Shape(Primitive):
def __init__(self):
"""Initialize Shape"""
def __infer__(self, x):
validator.check_subclass("input_x", x['dtype'], mstype.tensor, self.name)
out = {'shape': (),
'dtype': mstype.tuple_,
'value': tuple(x['shape'])}
return out
class DynamicShape(Primitive):
"""