class_docstr: The update block which contains the motion encoder, the recurrent block, and the flow head.
  
  It must expose a ``hidden_state_size`` attribute which is the hidden state size of its recurrent block.
class_docstr_tok: ["The","update","block","which","contains","the","motion","encoder",",","the","recurrent","block",",","and","the","flow","head",".","It","must","expose","a","``","hidden_state_size","``","attribute","which","is","the","hidden","state","size","of","its","recurrent","block","."]
code: def __init__(self, *, motion_encoder, recurrent_block, flow_head):
      super().__init__()
      self.motion_encoder = motion_encoder
      self.recurrent_block = recurrent_block
      self.flow_head = flow_head
  
      self.hidden_state_size = recurrent_block.hidden_size
  
imports: from typing import List, Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from torch.nn.modules.batchnorm import BatchNorm2d
  from torch.nn.modules.instancenorm import InstanceNorm2d
  from torchvision.ops import Conv2dNormActivation
  from ...transforms._presets import OpticalFlow
  from ...utils import _log_api_usage_once
  from .._api import register_model, Weights, WeightsEnum
  from .._utils import handle_legacy_interface
  from ._utils import grid_sample, make_coords_grid, upsample_flow
label_desc: Use image node_id 1 to create a new UpdateBlock object from inherited base classes: nn with example: obj = UpdateBlock()