parameters: (self, val)
docstring: Fills `self` with specific values.
  
          Args:
              val (Union[Number, List, Tuple, Matrix]): Values to fill, which should have dimension consistent with `self`.
docstring_summary: Fills `self` with specific values.
docstring_tokens: Fills self with specific values .
function: def fill(self, val):
          """Fills `self` with specific values.
  
          Args:
              val (Union[Number, List, Tuple, Matrix]): Values to fill, which should have dimension consistent with `self`.
          """
          if isinstance(val, numbers.Number):
              val = tuple(
                  [tuple([val for _ in range(self.m)]) for _ in range(self.n)])
          elif isinstance(val,
                          (list, tuple)) and isinstance(val[0], numbers.Number):
              assert self.m == 1
              val = tuple([(v, ) for v in val])
          elif isinstance(val, Matrix):
              val_tuple = []
              for i in range(val.n):
                  row = []
                  for j in range(val.m):
                      row.append(val(i, j))
                  row = tuple(row)
                  val_tuple.append(row)
              val = tuple(val_tuple)
          assert len(val) == self.n
          assert len(val[0]) == self.m
          from taichi._kernels import fill_matrix  # pylint: disable=C0415
          fill_matrix(self, val)
function_tokens: def fill ( self , val ) : if isinstance ( val , numbers . Number ) : val = tuple ( [ tuple ( [ val for _ in range ( self . m ) ] ) for _ in range ( self . n ) ] ) elif isinstance ( val , ( list , tuple ) ) and isinstance ( val [ 0 ] , numbers . Number ) : assert self . m == 1 val = tuple ( [ ( v , ) for v in val ] ) elif isinstance ( val , Matrix ) : val_tuple = [ ] for i in range ( val . n ) : row = [ ] for j in range ( val . m ) : row . append ( val ( i , j ) ) row = tuple ( row ) val_tuple . append ( row ) val = tuple ( val_tuple ) assert len ( val ) == self . n assert len ( val [ 0 ] ) == self . m from taichi . _kernels import fill_matrix # pylint: disable=C0415 fill_matrix ( self , val )