code: def testShapeSequenceInferenceNumpy(self, dtype):
      shape_seq = [
          (1, 1, 3, 1),
          (1, 1, 1, 2),
          (1, 1, 3, 2),
          (1, 5, 1, 1),
      ]
      init_val = np.zeros([1], dtype=dtype)
      prog = shape_sequence_program(shape_seq)
      typed = type_inference.infer_types(prog, [init_val], NP_BACKEND)
      self.assertEqual(
          {instructions.pc_var, "ans"}, set(typed.var_defs.keys())
      )
      self.assertEqual(dtype, typed.var_defs["ans"].tensors.dtype)
      # Note: the shapes used by the primop include the batch dimension, but the
      # returned type does not.
      self.assertEqual((5, 3, 2), typed.var_defs["ans"].tensors.shape)
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  import six
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.auto_batching import allocation_strategy
  from tensorflow_probability.python.experimental.auto_batching import instructions
  from tensorflow_probability.python.experimental.auto_batching import lowering
  from tensorflow_probability.python.experimental.auto_batching import numpy_backend
  from tensorflow_probability.python.experimental.auto_batching import test_programs
  from tensorflow_probability.python.experimental.auto_batching import tf_backend
  from tensorflow_probability.python.experimental.auto_batching import type_inference
  from tensorflow_probability.python.experimental.auto_batching import virtual_machine
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 2 for calling the TypeInferenceTest obj's underlying member method code with example usage: obj.testShapeSequenceInferenceNumpy(dtype) without return types