code: def fit_plane(points: Vector3) -> Hyperplane:
      """Fit a plane from a set of points using SVD.
  
      Args:
          points: tensor containing a batch of sets of n-dimensional points. The  expected
              shape of the tensor is :math:`(N, D)`.
  
      Return:
          The computed hyperplane object.
      """
      # TODO: fix to support more type check here
      # KORNIA_CHECK_SHAPE(points, ["N", "D"])
      if points.shape[-1] != 3:
          raise TypeError("vector must be (*, 3)")
  
      mean = points.mean(-2, True)
      points_centered = points - mean
  
      # NOTE: not optimal for 2d points, but for now works for other dimensions
      _, _, V = _torch_svd_cast(points_centered)
  
      # the first left eigenvector is the direction on the fited line
      direction = V[..., :, -1]  # BxD
      origin = mean[..., 0, :]  # BxD
  
      return Hyperplane.from_vector(Vector3(direction), Vector3(origin))
  
imports: from typing import Optional
  from kornia.core import Module, Tensor, stack, where
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_SHAPE, KORNIA_CHECK_TYPE
  from kornia.core.tensor_wrapper import unwrap, wrap
  from kornia.geometry.linalg import batched_dot_product
  from kornia.geometry.vector import Scalar, Vector3
  from kornia.utils.helpers import _torch_svd_cast
label_desc: Use image node_id 2 for calling a global function with example usage: fit_plane(points) and returns: Hyperplane