parameters: (self, keep_dims=False)
return_statement: return np.array(self.value).reshape(shape_ext)
docstring: Converts the Matrix to a numpy array.
  
          Args:
              keep_dims (bool, optional): Whether to keep the dimension after conversion.
                  When keep_dims=False, the resulting numpy array should skip the matrix dims with size 1.
  
          Returns:
              numpy.ndarray: The result numpy array.
docstring_summary: Converts the Matrix to a numpy array.
docstring_tokens: Converts the Matrix to a numpy array .
function: def to_numpy(self, keep_dims=False):
          """Converts the Matrix to a numpy array.
  
          Args:
              keep_dims (bool, optional): Whether to keep the dimension after conversion.
                  When keep_dims=False, the resulting numpy array should skip the matrix dims with size 1.
  
          Returns:
              numpy.ndarray: The result numpy array.
          """
          as_vector = self.m == 1 and not keep_dims
          shape_ext = (self.n, ) if as_vector else (self.n, self.m)
          return np.array(self.value).reshape(shape_ext)
function_tokens: def to_numpy ( self , keep_dims = False ) : as_vector = self . m == 1 and not keep_dims shape_ext = ( self . n , ) if as_vector else ( self . n , self . m ) return np . array ( self . value ) . reshape ( shape_ext )