code: def test_remove_symbolic_reshape():
      sym_b = Symbol("s0")
      original_shape = (sym_b, Symbol("s1"), 2)
      reshape_name = "reshape"
  
      @mb.program(input_specs=[mb.TensorSpec(shape=(sym_b, 4))])
      def prog(x):
          # const cannot represent symbolic values. Use _const_symbolic
          shape = mb._const_symbolic(val=original_shape)
          return mb.reshape(x=x, shape=shape, name=reshape_name)
  
      reshape_op = prog.find_ops(
          prefix=reshape_name, op_type="reshape", exactly_one=True
      )[0]
      shape_var = reshape_op.shape
      reshaped_var = reshape_op.outputs[0]
      assert np.all(shape_var.sym_val == original_shape)
      assert np.all(reshaped_var.shape == (sym_b, 2, 2))
  
      # Note: we cannot deepcopy prog with symbol.
      prev_outputs = [o.name for o in prog["main"].outputs]
      PASS_REGISTRY["common::remove_symbolic_reshape"](prog)
      curr_outputs = [o.name for o in prog["main"].outputs]
      assert curr_outputs == prev_outputs
  
      reshape_op = prog.find_ops(
          prefix=reshape_name, op_type="reshape", exactly_one=True
      )[0]
      shape_var = reshape_op.shape
      reshaped_var = reshape_op.outputs[0]
      # shape param cannot be symbolic after the pass
      assert np.all(shape_var.sym_val == (-1, 2, 2))
      # output shape is still symbolic
      assert np.all(reshaped_var.shape == (sym_b, 2, 2))
  
      if validate_model:
          assert_model_is_valid(prog, {"x": (3, 4)})
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/test_passes.py
imports: from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.testing_utils import assert_op_count_match, assert_model_is_valid, assert_same_output_names, get_op_types_in_program, apply_pass_and_basic_check
  from coremltools.converters.mil.mil import Symbol, types
  from coremltools.converters.mil.mil.passes.pass_registry import PASS_REGISTRY
  import copy
  import pytest
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: test_remove_symbolic_reshape() and returns: mb