src/transformers/models/perceiver/modeling_perceiver.py/PerceiverTrainablePositionEncoding/num_dimensions
class PerceiverTrainablePositionEncoding:    def num_dimensions(self) -> int:
        if isinstance(self._index_dims, int):
            return 1
        return len(self._index_dims)