src/transformers/models/perceiver/modeling_perceiver.py/PerceiverTrainablePositionEncoding/__init__
class PerceiverTrainablePositionEncoding:    def __init__(self, index_dims, num_channels=128):
        super().__init__()
        self._num_channels = num_channels
        self._index_dims = index_dims
        index_dim = np.prod(index_dims)
        self.position_embeddings = nn.Parameter(torch.randn(index_dim, num_channels))