original_docstring: 
          Convert a numpy array to a PyTorch tensor.
          Note: it copies the data by default
  
          :param array:
          :param copy: Whether to copy or not the data
              (may be useful to avoid changing things be reference)
          :return:
          
docstring: Convert a numpy array to a PyTorch tensor.
  Note: it copies the data by default
docstring_tokens: Convert a numpy array to a PyTorch tensor . Note : it copies the data by default
code: def to_torch(self, array: np.ndarray, copy: bool = True) -> th.Tensor:
          """
          Convert a numpy array to a PyTorch tensor.
          Note: it copies the data by default
  
          :param array:
          :param copy: Whether to copy or not the data
              (may be useful to avoid changing things be reference)
          :return:
          """
          if copy:
              return th.tensor(array).to(self.device)
          return th.as_tensor(array).to(self.device)
code_tokens: def to_torch ( self , array : np . ndarray , copy : bool = True ) -> th . Tensor : if copy : return th . tensor ( array ) . to ( self . device ) return th . as_tensor ( array ) . to ( self . device )
short_docstring: Convert a numpy array to a PyTorch tensor.
short_docstring_tokens: Convert a numpy array to a PyTorch tensor .
comment: """
          Convert a numpy array to a PyTorch tensor.
          Note: it copies the data by default
  
          :param array:
          :param copy: Whether to copy or not the data
              (may be useful to avoid changing things be reference)
          :return:
          """