    def to_meta(self):
        """Returns a torch.LongTensor that encodes partitioning information.

        Can be used along with ``data()`` to serialize a ``PartitionedTensor`` for
        communication.

        Returns:
            torch.LongTensor: a tensor encoding the meta-information for the partitioning
        """
        meta = []
        meta.append(len(self.orig_size))
        meta += list(self.orig_size)
        meta.append(self.num_parts)
        meta.append(self.rank)
        meta += self.partition
        return torch.LongTensor(data=meta).to(self.orig_device)
Returns a torch.LongTensor that encodes partitioning information.

Can be used along with ``data()`` to serialize a ``PartitionedTensor`` for
communication.

Returns:
torch.LongTensor: a tensor encoding the meta-information for the partitioning
opensora/adaptor/utils.py