code: def get_greatest_upper_bound(type1, type2):
      """
      Get the most precise type that's consistent with the given types
      """
      if type1 == Dyn:
          return type2
      elif type2 == Dyn:
          return type1
      elif isinstance(type1, TensorType) and isinstance(
          type2, TensorType
      ):
          if not is_consistent(type1, type2):
              raise TypeError(f"Inconsistent types {type1}, {type2}")
          gub = [
              t1 if is_more_precise(t1, t2) else t2
              for (t1, t2) in zip(type1.__args__, type2.__args__)
          ]
          return TensorType(tuple(gub))
  
imports: from functools import reduce
  import torch
  import operator
  from torch.fx.tensor_type import Dyn, is_consistent, TensorType, is_more_precise
  from typing import Callable, Dict
  from torch.fx.node import Target, Node
  from torch.nn.modules.batchnorm import BatchNorm2d
  from torch.nn.modules.conv import Conv2d
  from torch.fx.experimental.refinement_types import Equality
  import itertools
  from torch.fx.experimental.unification import Var
  import sympy
label_desc: Use image node_id 12 for calling a global function with example usage: get_greatest_upper_bound(type1, type2) and returns: type2, type1, TensorType