class_docstr: Module, which estimates the dominant gradient orientation of the given patches, in radians.
  
  Zero angle points towards right.
  
  Args:
      patch_size: size of the (square) input patch.
      num_angular_bins: number of histogram bins.
      eps: for safe division, and arctan.
class_docstr_tok: ["Module",",","which","estimates","the","dominant","gradient","orientation","of","the","given","patches",",","in","radians",".","Zero","angle","points","towards","right",".","Args",":","patch_size",":","size","of","the","(","square",")","input","patch",".","num_angular_bins",":","number","of","histogram","bins",".","eps",":","for","safe","division",",","and","arctan","."]
code: def __init__(
      self,
      patch_size: int = 32,
      num_angular_bins: int = 36,
      eps: float = 1e-8,
  ) -> None:
      super().__init__()
      self.patch_size = patch_size
      self.num_ang_bins = num_angular_bins
      self.gradient = SpatialGradient("sobel", 1)
      self.eps = eps
      self.angular_smooth = nn.Conv1d(
          1,
          1,
          kernel_size=5,
          padding=2,
          bias=False,
          padding_mode="circular",
      )
      with torch.no_grad():
          self.angular_smooth.weight[
              :
          ] = get_gaussian_discrete_kernel1d(5, 1.6)
      sigma: float = float(self.patch_size) / 6.0
      self.weighting = get_gaussian_kernel2d(
          (self.patch_size, self.patch_size), (sigma, sigma), True
      )
  
imports: from typing import Dict, Optional
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.constants import pi
  from kornia.core.check import KORNIA_CHECK_LAF, KORNIA_CHECK_SHAPE
  from kornia.filters import SpatialGradient, get_gaussian_discrete_kernel1d, get_gaussian_kernel2d
  from kornia.geometry import rad2deg
  from kornia.utils.helpers import map_location_to_cpu
  from .laf import extract_patches_from_pyramid, get_laf_orientation, set_laf_orientation
label_desc: Use image node_id 1 to create a new PatchDominantGradientOrientation object from inherited base classes: nn with example: obj = PatchDominantGradientOrientation(patch_size, num_angular_bins, eps)