mindspore.ops.SameTypeShape

class mindspore.ops.SameTypeShape[源代码]

Checks whether the data type and shape of two tensors are the same.

Refer to mindspore.ops.same_type_shape() for more detail.

Supported Platforms:

Ascend GPU CPU

Examples

>>> input_x = Tensor(np.array([[2, 2], [2, 2]]), mindspore.float32)
>>> input_y = Tensor(np.array([[2, 2], [2, 2]]), mindspore.float32)
>>> output = ops.SameTypeShape()(input_x, input_y)
>>> print(output)
[[2. 2.]
 [2. 2.]]