def get_batch(self, i):
        """ Get batch starting at token index i """

        end_idx = min(i + self.l_inc, self.data.size(-1)-1)
        beg_idx = max(0, i + self.l_inc - self.l_max)
        seq_len = end_idx - i

        data = self.data[..., beg_idx:end_idx]
        target = self.data[..., i+1 : end_idx+1]

        if self.pad_last and seq_len < self.l_inc:
            data = F.pad(data, (0, self.l_inc - seq_len)) # (batch_size, l_inc)
            target = F.pad(target, (0, self.l_inc - seq_len))
            seq_len = self.l_inc

        if not self.batch_first:
            data = data.transpose(0, 1).contiguous() # (n_batch, l_sequence)
            target = target.transpose(0, 1).contiguous()

        return data, target, {"l_output": seq_len} # Return length of desired output
 Get batch starting at token index i 
analyze/convnexts4nd/src/dataloaders/lm.py