class_docstr: Container for computing various correlation types between a left and right feature map.
  This module does not contain any optimisable parameters, it's solely a collection of ops.
  We wrap in a nn.Module for torch.jit.script compatibility
  
  Adaptive Group Correlation operations from: https://openaccess.thecvf.com/content/CVPR2022/papers/Li_Practical_Stereo_Matching_via_Cascaded_Recurrent_Network_With_Adaptive_Correlation_CVPR_2022_paper.pdf
  
  Canonical reference implementation: https://github.com/megvii-research/CREStereo/blob/master/nets/corr.py
class_docstr_tok: ["Container","for","computing","various","correlation","types","between","a","left","and","right","feature","map",".","This","module","does","not","contain","any","optimisable","parameters",",","it","'s","solely","a","collection","of","ops",".","We","wrap","in","a","nn.Module","for","torch.jit.script","compatibility","Adaptive","Group","Correlation","operations","from",":","https",":","\/\/openaccess.thecvf.com\/content\/CVPR2022\/papers\/Li_Practical_Stereo_Matching_via_Cascaded_Recurrent_Network_With_Adaptive_Correlation_CVPR_2022_paper.pdf","Canonical","reference","implementation",":","https",":","\/\/github.com\/megvii-research\/CREStereo\/blob\/master\/nets\/corr.py"]
code: def forward(
      self,
      left_features: Tensor,
      right_features: Tensor,
      flow: torch.Tensor,
      extra_offset: Optional[Tensor],
      window_type: str = "1d",
      iter_mode: bool = False,
  ) -> Tensor:
      if iter_mode or extra_offset is None:
          corr = self.iterative_correlation_layer(
              left_features, right_features, flow, window_type
          )
      else:
          corr = self.attention_offset_correlation_layer(
              left_features,
              right_features,
              flow,
              extra_offset,
              window_type,
          )  # type: ignore
      return corr
  
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 2 for calling the AdaptiveGroupCorrelationLayer obj's underlying member method code with example usage: obj.forward(left_features, right_features, flow, extra_offset, window_type, iter_mode) and returns: corr