mindspore.pytype_to_dtype

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

Convert python type to MindSpore type.

Parameters

obj (type) – A python type object.

Returns

Type of MindSpore type.

Raises

NotImplementedError – If the python type cannot be converted to MindSpore type.

Examples

>>> import mindspore as ms
>>> out = ms.pytype_to_dtype(bool)
>>> print(out)
Bool