parameters: (obj)
return_statement: return pytype_to_dtype(type(obj))
docstring: Get the MindSpore data type, which corresponds to python type or variable.
  
      Args:
          obj (type): An object of python type, or a variable of python type.
  
      Returns:
          Type of MindSpore type.
docstring_summary: Get the MindSpore data type, which corresponds to python type or variable.
docstring_tokens: Get the MindSpore data type which corresponds to python type or variable .
function: def get_py_obj_dtype(obj):
      """
      Get the MindSpore data type, which corresponds to python type or variable.
  
      Args:
          obj (type): An object of python type, or a variable of python type.
  
      Returns:
          Type of MindSpore type.
      """
      # Tensor
      if hasattr(obj, 'shape') and hasattr(obj, 'dtype') and isinstance(obj.dtype, typing.Type):
          return tensor_type(obj.dtype)
      # Primitive or Cell
      if hasattr(obj, '__primitive_flag__') or hasattr(obj, 'construct'):
          return function
      # mindspore type
      if isinstance(obj, typing.Type):
          return type_type
      # python type
      if isinstance(obj, type):
          return pytype_to_dtype(obj)
      # others
      return pytype_to_dtype(type(obj))
function_tokens: def get_py_obj_dtype ( obj ) : # Tensor if hasattr ( obj , 'shape' ) and hasattr ( obj , 'dtype' ) and isinstance ( obj . dtype , typing . Type ) : return tensor_type ( obj . dtype ) # Primitive or Cell if hasattr ( obj , '__primitive_flag__' ) or hasattr ( obj , 'construct' ) : return function # mindspore type if isinstance ( obj , typing . Type ) : return type_type # python type if isinstance ( obj , type ) : return pytype_to_dtype ( obj ) # others return pytype_to_dtype ( type ( obj ) )