def batch_seqlens_fn(self, batch):
            """ given a batch, return the size of every sequence in the batch """
            seqlens = []
            seqs, _ = batch
            for seq in seqs:
                pad_indices = (seq[:, 0] == self.padding_value).nonzero(as_tuple=True)[0]
                seqlens.append(len(seq) if len(pad_indices) == 0 else pad_indices[0].item())
            return torch.tensor(seqlens, dtype=torch.int64)
 given a batch, return the size of every sequence in the batch 
training/data_efficiency/variable_batch_size_and_lr/variable_batch_size_and_lr_example.py