parameters: (a, dtype=mstype.float32)
return_statement: return Tensor(a, dtype)
docstring: Converts the input to tensor. Note here `a` cannot be tensor itself.
docstring_summary: Converts the input to tensor. Note here `a` cannot be tensor itself.
docstring_tokens: Converts the input to tensor . Note here a cannot be tensor itself .
function: def asfarray_const(a, dtype=mstype.float32):
      """Converts the input to tensor. Note here `a` cannot be tensor itself."""
      _check_input_for_asarray(a)
      if isinstance(a, (list, tuple)):
          # Convert all tuple/nested tuples to lists
          a = _deep_list(a)
          # Convert all tensor sub-elements to numpy arrays
          a = _deep_tensor_to_nparray(a)
          a = onp.asarray(a)
          if a.dtype is onp.dtype('object'):
              raise ValueError(f"For Tensor conversion, the input_data is {a} that contains unsupported element.")
          a = Tensor.from_numpy(a)
  
      return Tensor(a, dtype)
function_tokens: def asfarray_const ( a , dtype = mstype . float32 ) : _check_input_for_asarray ( a ) if isinstance ( a , ( list , tuple ) ) : # Convert all tuple/nested tuples to lists a = _deep_list ( a ) # Convert all tensor sub-elements to numpy arrays a = _deep_tensor_to_nparray ( a ) a = onp . asarray ( a ) if a . dtype is onp . dtype ( 'object' ) : raise ValueError ( f"For Tensor conversion, the input_data is {a} that contains unsupported element." ) a = Tensor . from_numpy ( a ) return Tensor ( a , dtype )