code: def _merge_var(varname, obtained_type, inferred_types, backend):
      """Merges an updated auto-batching type for a single variable."""
      old_type = inferred_types[varname]
      new_type = instructions.pattern_map2(
          functools.partial(_merge_tensor_type, backend=backend),
          old_type.tensors,
          obtained_type,
          leaf_type=instructions.TensorType,
      )
      inferred_types[varname] = instructions.Type(new_type)
      if old_type != inferred_types[varname]:
          log_debug(
              "{}: {} -> {}".format(
                  varname, old_type, inferred_types[varname]
              )
          )
  
file_path: probability/tensorflow_probability/python/experimental/auto_batching/type_inference.py
imports: import contextlib
  import functools
  from absl import logging
  import six
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 3 for calling a global function with example usage: _merge_var(varname, obtained_type, inferred_types, backend) without return types