class_docstr: Module, which extracts patches using input images and local affine frames (LAFs).
  
  Then runs :class:`~kornia.feature.PatchAffineShapeEstimator` on patches to estimate LAFs shape.
  
  Then original LAF shape is replaced with estimated one. The original LAF orientation is not preserved,
  so it is recommended to first run LAFAffineShapeEstimator and then LAFOrienter,
  
  
  Args:
      patch_size: the input image patch size.
      affine_shape_detector: Patch affine shape estimator, :class:`~kornia.feature.PatchAffineShapeEstimator`.
      preserve_orientation: if True, the original orientation is preserved.
code: def __init__(
      self,
      patch_size: int = 32,
      affine_shape_detector: Optional[nn.Module] = None,
      preserve_orientation: bool = True,
  ) -> None:
      super().__init__()
      self.patch_size = patch_size
      self.affine_shape_detector = (
          affine_shape_detector
          or PatchAffineShapeEstimator(self.patch_size)
      )
      self.preserve_orientation = preserve_orientation
      if preserve_orientation:
          warnings.warn(
              "`LAFAffineShapeEstimator` default behaviour is changed "
              "and now it does preserve original LAF orientation. "
              "Make sure your code accounts for this.",
              DeprecationWarning,
              stacklevel=2,
          )
  
imports: import math
  import warnings
  from typing import Dict, Optional
  import torch
  from torch import nn
  from kornia.core.check import KORNIA_CHECK_LAF, KORNIA_CHECK_SHAPE
  from kornia.filters.kernels import get_gaussian_kernel2d
  from kornia.filters.sobel import SpatialGradient
  from kornia.utils.helpers import map_location_to_cpu
  from .laf import ellipse_to_laf, extract_patches_from_pyramid, get_laf_orientation, get_laf_scale, make_upright, scale_laf, set_laf_orientation
label_desc: Use image node_id 1 to create a new LAFAffineShapeEstimator object from inherited base classes: nn with example: obj = LAFAffineShapeEstimator(patch_size, affine_shape_detector, preserve_orientation)