parameters: (n, i, dt=None)
return_statement: return Vector([ops_mod.cast(int(j == i), dt) for j in range(n)])
docstring: Construct an unit Vector (1-D matrix) i.e., a vector with only one entry filled with one and all other entries zeros.
  
          Args:
              n (int): The length of the vector.
              i (int): The index of the entry that will be filled with one.
              dt (DataType, optional): The desired data type.
  
          Returns:
              :class:`~taichi.lang.matrix.Matrix`: An 1-D unit :class:`~taichi.lang.matrix.Matrix` instance.
docstring_summary: Construct an unit Vector (1-D matrix) i.e., a vector with only one entry filled with one and all other entries zeros.
docstring_tokens: Construct an unit Vector ( 1 - D matrix ) i . e . a vector with only one entry filled with one and all other entries zeros .
function: def unit(n, i, dt=None):
          """Construct an unit Vector (1-D matrix) i.e., a vector with only one entry filled with one and all other entries zeros.
  
          Args:
              n (int): The length of the vector.
              i (int): The index of the entry that will be filled with one.
              dt (DataType, optional): The desired data type.
  
          Returns:
              :class:`~taichi.lang.matrix.Matrix`: An 1-D unit :class:`~taichi.lang.matrix.Matrix` instance.
  
          """
          if dt is None:
              dt = int
          assert 0 <= i < n
          return Vector([ops_mod.cast(int(j == i), dt) for j in range(n)])
function_tokens: def unit ( n , i , dt = None ) : if dt is None : dt = int assert 0 <= i < n return Vector ( [ ops_mod . cast ( int ( j == i ) , dt ) for j in range ( n ) ] )