docstr: Input graph:
  
  main(x: ImageType(scale=2.0, bias=2.0, color_layout="G", channel_first=True)) {
      y1 = relu(x)
      y2 = relu(x)
      output = add(y1, y2)
  } [output]
  
  Output graph:
  
  main(x: ImageType(channel_first=True)) {
      y_scaled = mul(x, 2)
      y = add(y_scaled, 2)
      y1 = relu(y)
      y2 = relu(y)
      output = add(y1, y2)
  } [output]
docstr_tok: ["Input","graph",":","main","(","x",":","ImageType","(","scale=2.0",",","bias=2.0",",","color_layout=","''","G","''",",","channel_first=True",")",")","{","y1","=","relu","(","x",")","y2","=","relu","(","x",")","output","=","add","(","y1",",","y2",")","}","[","output","]","Output","graph",":","main","(","x",":","ImageType","(","channel_first=True",")",")","{","y_scaled","=","mul","(","x",",","2",")","y","=","add","(","y_scaled",",","2",")","y1","=","relu","(","y",")","y2","=","relu","(","y",")","output","=","add","(","y1",",","y2",")","}","[","output","]"]
code: def test_program_grayscale_with_scale_bias(self):
      """
      Input graph:
  
      main(x: ImageType(scale=2.0, bias=2.0, color_layout="G", channel_first=True)) {
          y1 = relu(x)
          y2 = relu(x)
          output = add(y1, y2)
      } [output]
  
      Output graph:
  
      main(x: ImageType(channel_first=True)) {
          y_scaled = mul(x, 2)
          y = add(y_scaled, 2)
          y1 = relu(y)
          y2 = relu(y)
          output = add(y1, y2)
      } [output]
      """
  
      @mb.program(input_specs=[mb.TensorSpec(shape=(1, 1, 20, 20))])
      def prog(x):
          y1 = mb.relu(x=x)
          y2 = mb.relu(x=x)
          z = mb.add(x=y1, y=y2)
          return z
  
      prog.main_input_types = (
          ct.ImageType(
              name="x",
              shape=[1, 1, 20, 20],
              scale=2.0,
              bias=2.0,
              color_layout="G",
              channel_first=True,
          ),
      )
  
      prev_prog, prev_block, block = apply_pass_and_basic_check(
          prog, "mil_backend::insert_image_preprocessing_ops"
      )
      assert get_op_types_in_program(prev_prog) == [
          "relu",
          "relu",
          "add",
      ]
      assert get_op_types_in_program(prog) == [
          "mul",
          "add",
          "relu",
          "relu",
          "add",
      ]
      scale_op = prog.find_ops(op_type="mul", exactly_one=True)[0]
      assert scale_op.y.val == 2.0
      add_op = prog.find_ops(op_type="add", exactly_one=False)[0]
      assert add_op.y.val == 2.0
  
imports: import copy
  import itertools
  import numpy
  import pytest
  import coremltools
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  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 4 for calling the TestImagePreprocessingPass obj's underlying member method code with example usage: obj.test_program_grayscale_with_scale_bias() and returns: z