code: def batch_encode(self, iterator, *args, dim=0, **kwargs):
          
          return torch.stack(super().batch_encode(iterator, *args, **kwargs), dim=dim)
docs: Args:
              iterator (iterator): Batch of labels to encode.
              *args: Arguments passed to ``Encoder.batch_encode``.
              dim (int, optional): Dimension along which to concatenate tensors.
              **kwargs: Keyword arguments passed to ``Encoder.batch_encode``.
  
          Returns:
              torch.Tensor: Tensor of encoded labels.