code: def get_shape(
      x: Union[Tuple, List, Dict]
  ) -> Union[Tuple, List, Dict]:
      """
      Some layer may take/generate tuple/list/dict/list[dict] as input/output in forward function.
      We recursively query tensor shape.
      """
      if isinstance(x, (list, tuple)):
          assert (
              len(x) > 0
          ), "x of tuple/list type must have at least one element"
          return [get_shape(xi) for xi in x]
      elif isinstance(x, dict):
          return {k: get_shape(v) for k, v in x.items()}
      else:
          assert isinstance(
              x, torch.Tensor
          ), "x is expected to be a torch tensor"
          return x.size()
  
imports: import collections.abc
  import logging
  import operator
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from classy_vision.generic.util import eval_model, get_batchsize_per_replica, get_model_dummy_input, is_leaf, is_on_gpu
  from torch.cuda import cudart
label_desc: Use image node_id 2 for calling a global function with example usage: get_shape(x) and returns: unknown, unknown, x