class_docstr: Input graph:
  input -----> transpose(axis=[1,0]) -----> transpose(axis=[1,0]) ---> out
  
  Output graph:
  input -----> identity -----> out
class_docstr_tok: ["Input","graph",":","input","--","--","-",">","transpose","(","axis=","[","1,0","]",")","--","--","-",">","transpose","(","axis=","[","1,0","]",")","--","-",">","out","Output","graph",":","input","--","--","-",">","identity","--","--","-",">","out"]
docstr: Input graph:
                                                          input (shape=(3,))
                                                               |
  input (shape=(1,4,3,2)) --> transpose (shape=(1,2,4,3)) --> add --> transpose --> relu
  
  Output graph:
  
                            input (shape=(3,))
                               |
                           reshape (shape=(1,1,3,1))
                               |
  input (shape=(1,4,3,2)) --> add --> relu
docstr_tok: ["Input","graph",":","input","(","shape=","(","3",",",")",")","|","input","(","shape=","(","1,4,3,2",")",")","--",">","transpose","(","shape=","(","1,2,4,3",")",")","--",">","add","--",">","transpose","--",">","relu","Output","graph",":","input","(","shape=","(","3",",",")",")","|","reshape","(","shape=","(","1,1,3,1",")",")","|","input","(","shape=","(","1,4,3,2",")",")","--",">","add","--",">","relu"]
code: def test_binary_op_with_non_constant_input1(self):
      """
      Input graph:
                                                              input (shape=(3,))
                                                                   |
      input (shape=(1,4,3,2)) --> transpose (shape=(1,2,4,3)) --> add --> transpose --> relu
  
      Output graph:
  
                                input (shape=(3,))
                                   |
                               reshape (shape=(1,1,3,1))
                                   |
      input (shape=(1,4,3,2)) --> add --> relu
      """
  
      @mb.program(
          input_specs=[
              mb.TensorSpec(shape=(1, 4, 3, 2)),
              mb.TensorSpec(shape=(3,)),
          ]
      )
      def prog(x, y):
          x = mb.transpose(x=x, perm=[0, 3, 1, 2])
          x = mb.add(x=x, y=y)
          x = mb.transpose(x=x, perm=[0, 2, 3, 1])
          x = mb.relu(x=x)
          return x
  
      prev_prog, prev_block, block = apply_pass_and_basic_check(
          prog, "common::reduce_transposes"
      )
      self.assertEqual(
          get_op_types_in_program(prev_prog),
          ["transpose", "add", "transpose", "relu"],
      )
      self.assertEqual(
          get_op_types_in_program(prog), ["reshape", "add", "relu"]
      )
      reshape_op = prog.find_ops(op_type="reshape", exactly_one=True)[0]
      assert reshape_op.outputs[0].shape == (1, 1, 3, 1)
      assert_model_is_valid(
          prog,
          {"x": (1, 4, 3, 2), "y": (3,)},
          expected_output_shapes={block.outputs[0].name: (1, 4, 3, 2)},
      )
  
imports: import unittest
  import numpy
  import pytest
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import get_new_symbol
  from coremltools.converters.mil.mil.passes.defs.optimize_repeat_ops import TransformAxisUpdateOps
  from coremltools.converters.mil.mil.passes.pass_registry import PASS_REGISTRY
  from coremltools.converters.mil.testing_utils import apply_pass_and_basic_check, assert_model_is_valid, get_op_types_in_program
label_desc: Use image node_id 40 for calling the TransposeOptimizationPass obj's underlying member method code with example usage: obj.test_binary_op_with_non_constant_input1() and returns: x