code: def __init__(
      self,
      groups: int = 4,
      attention_module: Optional[nn.Module] = None,
      search_window_1d: Tuple[int, int] = (1, 9),
      search_dilate_1d: Tuple[int, int] = (1, 1),
      search_window_2d: Tuple[int, int] = (3, 3),
      search_dilate_2d: Tuple[int, int] = (1, 1),
  ) -> None:
      super().__init__()
      _check_window_specs(
          search_window_1d=search_window_1d,
          search_dilate_1d=search_dilate_1d,
          search_window_2d=search_window_2d,
          search_dilate_2d=search_dilate_2d,
      )
      # convert to python scalar
      self.search_pixels = int(np.prod(search_window_1d))
      self.groups = groups
  
      # two selection tables for dealing with the small_patch argument in the forward function
      self.patch_sizes = {
          "2d": [search_window_2d for _ in range(self.groups)],
          "1d": [search_window_1d for _ in range(self.groups)],
      }
  
      self.dilate_sizes = {
          "2d": [search_dilate_2d for _ in range(self.groups)],
          "1d": [search_dilate_1d for _ in range(self.groups)],
      }
  
      self.attention_module = attention_module
  
imports: import math
  from functools import partial
  from typing import Callable, Dict, Iterable, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torchvision.models.optical_flow.raft
  from torch import Tensor
  from torchvision.models._api import register_model, Weights, WeightsEnum
  from torchvision.models._utils import handle_legacy_interface
  from torchvision.models.optical_flow._utils import grid_sample, make_coords_grid, upsample_flow
  from torchvision.ops import Conv2dNormActivation
  from torchvision.prototype.transforms._presets import StereoMatching
label_desc: Use image node_id 1 to create a new AttentionOffsetCorrelationLayer object from inherited base classes: nn with example: obj = AttentionOffsetCorrelationLayer(groups, attention_module, search_window_1d, search_dilate_1d, search_window_2d, search_dilate_2d)