class_docstr: Sine-cosine positional encoder for input points.
docstr: Apply positional encoding to input.
  
  Args:
      x: Positionsl (or directional) tensor to encode: Tensor
  
  Returns:
      Tensor with encoded position/direction: Tensor
docstr_tok: ["Apply","positional","encoding","to","input",".","Args",":","x",":","Positionsl","(","or","directional",")","tensor","to","encode",":","Tensor","Returns",":","Tensor","with","encoded","position\/direction",":","Tensor"]
code: 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)
  
file_path: kornia/kornia/nerf/positional_encoder.py
imports: from functools import partial
  import torch
  from torch import nn
  from kornia.core import Tensor
label_desc: Use image node_id 3 for calling the PositionalEncoder obj's underlying member method code with example usage: obj.forward(x) and returns: torch