class_docstr: Module, which computes gradients of given patches, stacked as [magnitudes, orientations].
  
  Given gradients $g_x$, $g_y$ with respect to $x$, $y$ respectively,
    - $\mathbox{mags} = $\sqrt{g_x^2 + g_y^2 + eps}$
    - $\mathbox{oris} = $\mbox{tan}^{-1}(\nicefrac{g_y}{g_x})$.
  
  Args:
      patch_size: Input patch size in pixels.
  
  Returns:
      gradients of given patches.
  
  Shape:
      - Input: (B, 1, patch_size, patch_size)
      - Output: (B, 2, patch_size, patch_size)
  
  Example:
      >>> patches = torch.rand(23, 1, 32, 32)
      >>> gradient = MKDGradients()
      >>> g = gradient(patches) # 23x2x32x32
class_docstr_tok: ["Module",",","which","computes","gradients","of","given","patches",",","stacked","as","[","magnitudes",",","orientations","]",".","Given","gradients","$","g_x","$",",","$","g_y","$","with","respect","to","$","x","$",",","$","y","$","respectively",",","-","$","\\mathbox","{","mags","}","=","$","\\sqrt","{","g_x^2","+","g_y^2","+","eps","}","$","-","$","\\mathbox","{","oris","}","=","$","\\mbox","{","tan","}","^","{","-1","}","(","\\nicefrac","{","g_y","}","{","g_x","}",")","$",".","Args",":","patch_size",":","Input","patch","size","in","pixels",".","Returns",":","gradients","of","given","patches",".","Shape",":","-","Input",":","(","B",",","1",",","patch_size",",","patch_size",")","-","Output",":","(","B",",","2",",","patch_size",",","patch_size",")","Example",":",">",">",">","patches","=","torch.rand","(","23",",","1",",","32",",","32",")",">",">",">","gradient","=","MKDGradients","(",")",">",">",">","g","=","gradient","(","patches",")","#","23x2x32x32"]
code: def __repr__(self) -> str:
      return self.__class__.__name__
  
imports: from typing import Any, Dict, List, Tuple, Union
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.constants import pi
  from kornia.core import Tensor, cos, sin, tensor, zeros
  from kornia.filters import GaussianBlur2d, SpatialGradient
  from kornia.geometry.conversions import cart2pol
  from kornia.utils import create_meshgrid
  from kornia.utils.helpers import map_location_to_cpu
label_desc: Use image node_id 3 for calling the MKDGradients obj's underlying member method code with example usage: obj.__repr__() and returns: self