code: def find_fundamental(
      points1: Tensor,
      points2: Tensor,
      weights: Optional[Tensor] = None,
      method: Literal["8POINT", "7POINT"] = "8POINT",
  ) -> Tensor:
      r"""
      Args:
          points1: A set of points in the first image with a tensor shape :math:`(B, N, 2), N>=8`.
          points2: A set of points in the second image with a tensor shape :math:`(B, N, 2), N>=8`.
          weights: Tensor containing the weights per point correspondence with a shape of :math:`(B, N)`.
          method: The method to use for computing the fundamental matrix. Supported methods are "7POINT" and "8POINT".
  
      Returns:
          the computed fundamental matrix with shape :math:`(B, 3*m, 3)`, where `m` number of fundamental matrix.
  
      Raises:
          ValueError: If an invalid method is provided.
  
      """
      if method.upper() == "7POINT":
          result = run_7point(points1, points2)
      elif method.upper() == "8POINT":
          result = run_8point(points1, points2, weights)
      else:
          raise ValueError(
              f"Invalid method: {method}. Supported methods are '7POINT' and '8POINT'."
          )
      return result
  
file_path: kornia/kornia/geometry/epipolar/fundamental.py
imports: from typing import Literal, Optional, Tuple
  import torch
  from kornia.core import Tensor, concatenate, ones_like, stack, where, zeros
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.geometry.conversions import convert_points_from_homogeneous, convert_points_to_homogeneous
  from kornia.geometry.linalg import transform_points
  from kornia.geometry.solvers import solve_cubic
  from kornia.utils.helpers import _torch_svd_cast
label_desc: Use image node_id 5 for calling a global function with example usage: find_fundamental(points1, points2, weights, method) and returns: result