code: def _add_input_tensor_size_lut_hook(
      module: nn.Module,
      input_tensor_size_lut: Dict,
      hook_handle_list: List,
      base_name: str = "",
  ) -> None:
      """
      This helper function recursively goes through all modules in a network, registers
      forward hook function to each module. The hook function records the input tensor
      size in forward in input_tensor_size_lut[base_name].
      Args:
          module (nn.Module): input module to add hook recursively.
          input_tensor_size_lut (dict): lut to record input tensor size for hook function.
          hook_handle_list (list): a list to contain hook handles.
          base_name (str): name for module input.
      """
  
      def hook_fn(_, _in, _out):
          if isinstance(_in[0], torch.Tensor):
              input_tensor_size_lut[base_name] = tuple(_in[0].size())
          return
  
      handle = module.register_forward_hook(hook_fn)
      hook_handle_list.append(handle)
      for name, child in module.named_children():
          _add_input_tensor_size_lut_hook(
              child,
              input_tensor_size_lut,
              hook_handle_list,
              base_name=f"{base_name}.{name}",
          )
  
imports: from copy import deepcopy
  from typing import Dict, List
  import torch
  import torch.nn
  from pytorchvideo.accelerator.efficient_blocks.efficient_block_base import EfficientBlockBase
label_desc: Use image node_id 1 for calling a global function with example usage: _add_input_tensor_size_lut_hook(module, input_tensor_size_lut, hook_handle_list, base_name) without return types