parameters: (self, data)
return_statement: return data
docstring: Convert data type to numpy array.
  
          Args:
              data (Object): Input data.
  
          Returns:
              Ndarray, data with `np.ndarray` type.
docstring_summary: Convert data type to numpy array.
docstring_tokens: Convert data type to numpy array .
function: def _convert_data(self, data):
          """
          Convert data type to numpy array.
  
          Args:
              data (Object): Input data.
  
          Returns:
              Ndarray, data with `np.ndarray` type.
          """
          if isinstance(data, Tensor):
              data = data.asnumpy()
          elif isinstance(data, list):
              data = np.array(data)
          elif isinstance(data, np.ndarray):
              pass
          else:
              raise TypeError(f"For 'Metric' and its derived classes, the input data type must be tensor, list or "
                              f"numpy.ndarray, but got {type(data)}.")
          return data
function_tokens: def _convert_data ( self , data ) : if isinstance ( data , Tensor ) : data = data . asnumpy ( ) elif isinstance ( data , list ) : data = np . array ( data ) elif isinstance ( data , np . ndarray ) : pass else : raise TypeError ( f"For 'Metric' and its derived classes, the input data type must be tensor, list or " f"numpy.ndarray, but got {type(data)}." ) return data