mindspore.ops.IsInstance

class mindspore.ops.IsInstance[源代码]

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

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