code: def broadcasting_inference_rule(
      n: Node, symbols, constraints, counter
  ):
      op_code = None
      if n.target == operator.add or n.target == torch.add:
          op_code = op_add
      elif n.target == operator.mul:
          op_code = op_mul
  
      if isinstance(n.args[0], Node) and isinstance(n.args[1], Node):
          if isinstance(symbols[n.args[0]], TVar) and isinstance(
              symbols[n.args[1]], TVar
          ):
              my_output, counter = gen_tvar(counter)
              symbols[n] = my_output
              e1 = symbols[n.args[0]]
              e2 = symbols[n.args[1]]
  
              return gen_broadcasting_constraints(
                  e1, e2, symbols, counter, my_output
              )
          else:
              raise NotImplementedError("Method not yet implemented")
  
      elif isinstance(n.args[0], Node) and isinstance(
          n.args[1], (int, float)
      ):
          if isinstance(symbols[n.args[0]], TVar):
              my_output, counter = gen_tvar(counter)
              symbols[n] = my_output
              e1 = symbols[n.args[0]]
              return [BinConstraintT(my_output, e1, op_eq)], counter
          elif isinstance(symbols[n.args[0]], DVar):
              my_output, counter = gen_dvar(counter)
              symbols[n] = my_output
              e1 = symbols[n.args[0]]
  
              # we will propagate the runtime value here since this is regular addition
              c = Conj(
                  [
                      BinConstraintD(
                          my_output,
                          BinConstraintD(e1, n.args[1], op_code),
                          op_eq,
                      ),
                      BinConstraintD(0, my_output, op_leq),
                  ]
              )
              return [c], counter
  
      elif isinstance(n.args[1], Node) and isinstance(
          n.args[0], (int, float)
      ):
          if isinstance(symbols[n.args[1]], TVar):
              my_output, counter = gen_tvar(counter)
              symbols[n] = my_output
              e2 = symbols[n.args[1]]
              return [BinConstraintT(my_output, e2, op_eq)], counter
          elif isinstance(symbols[n.args[1]], DVar):
              my_output, counter = gen_dvar(counter)
              symbols[n] = my_output
              e2 = symbols[n.args[1]]
  
              # we will propagate the runtime value here since this is regular addition
              c = Conj(
                  [
                      BinConstraintD(
                          my_output,
                          BinConstraintD(e2, n.args[0], op_code),
                          op_eq,
                      ),
                      BinConstraintD(0, my_output, op_leq),
                  ]
              )
              return [c], counter
  
          else:
              raise NotImplementedError("Method not yet implemented")
  
      else:
          # TODO generate add constraints for scalar addition
          raise NotImplementedError("Addition not yet implemented")
  
imports: import torch
  import operator
  import warnings
  from typing import Callable, Dict, Iterable
  from torch.fx._symbolic_trace import _assert_is_none
  from torch.fx.experimental.migrate_gradual_types.constraint import ApplyBroadcasting, CalcProduct, Disj, TGreatestUpperBound, CalcMaxPool, CalcConv, Conj, BinConstraintT, CanReshape, BinConstraintD, GetItem, T, F, TVar, DVar, GetItemTensor, IndexSelect, Transpose, DGreatestUpperBound
  from torch.fx.experimental.migrate_gradual_types.operation import op_eq, op_matching, op_consistency, op_leq, op_precision, op_gt, op_div, op_sub, op_neq, op_lt, op_add, op_mul
  from torch.fx.node import Target, Node
  from torch.fx.experimental.migrate_gradual_types.util import gen_tensor_dims, gen_nat_constraints, gen_dvar, gen_tvar, gen_bvar
  from torch.fx.tensor_type import Dyn, TensorType
  from torch.nn.modules.conv import Conv2d
  from torch.nn.modules.batchnorm import BatchNorm2d
label_desc: Use image node_id 28 for calling a global function with example usage: broadcasting_inference_rule(n, symbols, constraints, counter) and returns: gen_broadcasting_constraints, list,  counter, list,  counter, list,  counter, list,  counter