nlpmodels/utils/train.py
def _reformat_data(self, data: Tuple) -> Tuple:
        """
        A generic function to reformat data for the problem.

        In this case, it's moving the data to the correct device.

        Args:
            data(Tuple): A tuple containing the input, context tensors.

        Returns:
            A tuple containing the input, context tensors on a gpu.
        """
        # place data on the correct device
        return data[0].to(self._device), data[1].to(self._device)

        A generic function to reformat data for the problem.

        In this case, it's moving the data to the correct device.

        Args:
            data(Tuple): A tuple containing the input, context tensors.

        Returns:
            A tuple containing the input, context tensors on a gpu.
        
A generic function to reformat data for the problem.
In this case, it's moving the data to the correct device.
A generic function to reformat data for the problem . In this case it ' s moving the data to the correct device .
def _reformat_data(self, data: Tuple) -> Tuple:
        return data[0].to(self._device), data[1].to(self._device)
def _reformat_data ( self , data : Tuple ) -> Tuple : return data [ 0 ] . to ( self . _device ) , data [ 1 ] . to ( self . _device )
A generic function to reformat data for the problem.
A generic function to reformat data for the problem .
"""
        A generic function to reformat data for the problem.

        In this case, it's moving the data to the correct device.

        Args:
            data(Tuple): A tuple containing the input, context tensors.

        Returns:
            A tuple containing the input, context tensors on a gpu.
        """ # place data on the correct device
A tuple containing the input, context tensors on a gpu.
A tuple containing the input context tensors on a gpu .
self
data
Tuple
A tuple containing the input, context tensors.
A tuple containing the input context tensors .