def to(self, *args, **kwargs) -> 'MultilevelPixelData':
        """Apply same name function to all tensors in data_fields."""
        new_data = self.new()
        for k, v in self.items():
            if hasattr(v[0], 'to'):
                v = [v_.to(*args, **kwargs) for v_ in v]
                data = {k: v}
                new_data.set_data(data)
        return new_data
Apply same name function to all tensors in data_fields.
mmpose/mmpose/structures/multilevel_pixel_data.py