def forward(self, x: Tensor) -> Tensor:
        """Apply positional encoding to input.

        Args:
            x: Positionsl (or directional) tensor to encode: Tensor

        Returns:
            Tensor with encoded position/direction: Tensor

        """
        if x.ndim < 1:
            raise ValueError("Input tensor represents a scalar")
        if x.shape[-1] != self._num_dims:
            raise ValueError(
                f"Input tensor number of dimensions {x.shape[-1]} does not match instantiated dimensionality "
                f"{self._num_dims}"
            )
        return torch.cat([fn(x) for fn in self._embed_fns], dim=-1)
Apply positional encoding to input.

        Args:
            x: Positionsl (or directional) tensor to encode: Tensor

        Returns:
            Tensor with encoded position/direction: Tensor

        
kornia/nerf/positional_encoder.py