mindspore.ops.is_tensor

View Source On Gitee
mindspore.ops.is_tensor(obj)[source]

Check whether the input object is a mindspore.Tensor .

Parameters

obj (Object) – input object.

Returns

Bool. Return True if obj is a Tensor, otherwise, return False.

Supported Platforms:

Ascend GPU CPU

Examples

>>> from mindspore import Tensor, ops
>>> a = Tensor([1.9, 2.2, 3.1])
>>> ops.is_tensor(a)
True