class_docstr: Context Encoder for Raft-Stereo (see paper section 3.1) that may have shared weight with the Feature Encoder.
  
  The ContextEncoder takes left image as input, and it outputs concatenated hidden_states and contexts.
  In Raft-Stereo we have multi level GRUs and this context encoder will also multi outputs (list of Tensor)
  that correspond to each GRUs.
  Take note that the length of "out_with_blocks" parameter represent the number of GRU's level.
  args:
      base_encoder (nn.Module): The base encoder part that can have a shared weight with feature_encoder's
          base_encoder because they have same architecture.
      out_with_blocks (List[bool]): The length represent the number of GRU's level (length of output), and
          if the element is True then the output layer on that position will have additional block
      output_dim (int): The dimension of output on each level (default: 256)
      block (Callable[..., nn.Module]): The type of basic block used for downsampling and output layer
          (default: ResidualBlock)
class_docstr_tok: ["Context","Encoder","for","Raft-Stereo","(","see","paper","section","3.1",")","that","may","have","shared","weight","with","the","Feature","Encoder",".","The","ContextEncoder","takes","left","image","as","input",",","and","it","outputs","concatenated","hidden_states","and","contexts",".","In","Raft-Stereo","we","have","multi","level","GRUs","and","this","context","encoder","will","also","multi","outputs","(","list","of","Tensor",")","that","correspond","to","each","GRUs",".","Take","note","that","the","length","of","``","out_with_blocks","''","parameter","represent","the","number","of","GRU","'s","level",".","args",":","base_encoder","(","nn.Module",")",":","The","base","encoder","part","that","can","have","a","shared","weight","with","feature_encoder's","base_encoder","because","they","have","same","architecture",".","out_with_blocks","(","List","[","bool","]",")",":","The","length","represent","the","number","of","GRU","'s","level","(","length","of","output",")",",","and","if","the","element","is","True","then","the","output","layer","on","that","position","will","have","additional","block","output_dim","(","int",")",":","The","dimension","of","output","on","each","level","(","default",":","256",")","block","(","Callable","[","...",",","nn.Module","]",")",":","The","type","of","basic","block","used","for","downsampling","and","output","layer","(","default",":","ResidualBlock",")"]
code: def forward(self, x: Tensor) -> List[Tensor]:
      x = self.base_encoder(x)
      outs = []
      for layer_dict in self.downsample_and_out_layers:
          x = layer_dict["downsampler"](x)
          outs.append(
              torch.cat(
                  [
                      layer_dict["out_hidden_state"](x),
                      layer_dict["out_context"](x),
                  ],
                  dim=1,
              )
          )
      return outs
  
imports: from functools import partial
  from typing import Callable, List, Optional, Tuple
  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.models.optical_flow.raft import FlowHead, MotionEncoder, ResidualBlock
  from torchvision.ops import Conv2dNormActivation
  from torchvision.prototype.transforms._presets import StereoMatching
  from torchvision.utils import _log_api_usage_once
label_desc: Use image node_id 4 for calling the MultiLevelContextEncoder obj's underlying member method code with example usage: obj.forward(x) and returns: outs