docstr: Test conv bias fusion when const input.
  
  
  Input graph:
                                  Const
                                    |
                                    V
  input -----> convolution -----> add/sub  ---> out
  
  Output graph:
  input -----> convolution -----> out
docstr_tok: ["Test","conv","bias","fusion","when","const","input",".","Input","graph",":","Const","|","V","input","--","--","-",">","convolution","--","--","-",">","add\/sub","--","-",">","out","Output","graph",":","input","--","--","-",">","convolution","--","--","-",">","out"]
code: def test_conv_bias_fusion(self, compute_unit, backend):
      """
      Test conv bias fusion when const input.
  
  
      Input graph:
                                      Const
                                        |
                                        V
      input -----> convolution -----> add/sub  ---> out
  
      Output graph:
      input -----> convolution -----> out
      """
      weight = np.array([2.5], dtype=np.float32).reshape([1, 1, 1, 1])
  
      def build(x):
          x = mb.conv(x=x, weight=weight)
          bias = mb.const(val=[10.0])
          return mb.add(x=x, y=bias)
  
      input = np.array([1, 2, 3, 4], dtype=np.float32).reshape(
          (1, 1, 2, 2)
      )
      output = np.array(
          [12.5, 15.0, 17.5, 20.0], dtype=np.float32
      ).reshape((1, 1, 2, 2))
      expected_output_types = output.shape + (types.fp32,)
      expected_outputs = [output]
      input_placeholders = {"x": mb.placeholder(shape=input.shape)}
      input_values = {"x": input}
  
      run_compare_builder(
          build,
          input_placeholders,
          input_values,
          expected_output_types,
          expected_outputs,
          compute_unit=compute_unit,
          backend=backend,
      )
  
imports: import itertools
  import numpy
  import pytest
  import coremltools
  from coremltools._deps import _HAS_TORCH, MSG_TORCH_NOT_FOUND
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import get_new_symbol, types
  from coremltools.converters.mil.mil.ops.tests.iOS14 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import run_compare_builder
  from coremltools.converters.mil.testing_reqs import compute_units
  from coremltools.converters.mil.testing_utils import random_gen
label_desc: Use image node_id 5 for calling the TestConv obj's underlying member method code with example usage: obj.test_conv_bias_fusion(compute_unit, backend) and returns: mb