mindspore.ops.IsInstance

class mindspore.ops.IsInstance(*args, **kwargs)[source]

Checks whether an object is an instance of a target type.

Inputs:
  • inst (Any Object) - The instance to be checked. Only constant value is allowed.

  • type_ (mindspore.dtype) - The target type. Only constant value is allowed.

Outputs:

bool, the check result.

Raises

TypeError – If type_ is not a Type.

Supported Platforms:

Ascend GPU CPU

Examples

>>> a = 1
>>> output = ops.IsInstance()(a, mindspore.int32)
>>> print(output)
False