mindspore.is_tensor
- mindspore.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, is_tensor >>> a = Tensor([1.9, 2.2, 3.1]) >>> is_tensor(a) True