code: def test_conv_crop_bn_relu_to_conv_bn_relu_crop(self):
      input_features = [("data", datatypes.Array(1, 10, 10))]
      output_features = [("out", None)]
      builder = neural_network.NeuralNetworkBuilder(
          input_features, output_features
      )
  
      W = np.ones((1, 2, 2, 2), dtype=np.float32)
      builder.add_convolution(
          name="conv",
          kernel_channels=1,
          output_channels=2,
          height=2,
          width=2,
          stride_height=1,
          stride_width=1,
          border_mode="valid",
          groups=1,
          W=W,
          b=None,
          has_bias=False,
          input_name="data",
          output_name="conv_out",
      )
      builder.add_crop(
          name="crop",
          left=1,
          right=1,
          top=1,
          bottom=1,
          offset=0,
          input_names=["conv_out"],
          output_name="crop_out",
      )
      builder.add_batchnorm(
          name="bn",
          channels=2,
          gamma=np.ones(
              2,
          ).astype(np.float32),
          beta=np.ones(
              2,
          ).astype(np.float32),
          mean=np.ones(
              2,
          ).astype(np.float32),
          variance=np.ones(
              2,
          ).astype(np.float32),
          input_name="crop_out",
          output_name="bn_out",
      )
      builder.add_activation(
          name="relu",
          non_linearity="RELU",
          input_name="bn_out",
          output_name="out",
      )
      # Conv -> Crop -> BN -> ReLU
      spec = builder.spec.neuralNetwork
      np.testing.assert_equal(
          "crop", spec.layers[1].WhichOneof("layer")
      )
      np.testing.assert_equal(
          "batchnorm", spec.layers[2].WhichOneof("layer")
      )
      np.testing.assert_equal(
          "activation", spec.layers[3].WhichOneof("layer")
      )
  
      # Predict
      if _IS_MACOS:
          mlmodel = MLModel(
              builder.spec, compute_units=ComputeUnit.CPU_ONLY
          )
          data = np.random.rand(1, 10, 10)
          data_dict = {"data": data}
          before_pass_out = mlmodel.predict(data_dict)["out"]
  
      # transform the pattern
      transform_conv_crop(builder.spec)
      # Conv -> BN -> ReLU -> Crop
      np.testing.assert_equal(
          "batchnorm", spec.layers[1].WhichOneof("layer")
      )
      np.testing.assert_equal(
          "activation", spec.layers[2].WhichOneof("layer")
      )
      np.testing.assert_equal(
          "crop", spec.layers[3].WhichOneof("layer")
      )
  
      # Predict
      mlmodel = MLModel(
          builder.spec, compute_units=ComputeUnit.CPU_ONLY
      )
      if _IS_MACOS:
          after_pass_out = mlmodel.predict(data_dict)["out"]
          np.testing.assert_almost_equal(
              before_pass_out, after_pass_out, decimal=3
          )
  
imports: import copy
  import unittest
  from sys import platform
  import numpy
  import coremltools.models.datatypes
  from coremltools import ComputeUnit
  from coremltools._deps import _IS_MACOS
  from coremltools.converters.mil.backend.nn.passes.mlmodel_passes import remove_disconnected_layers, remove_redundant_transposes, transform_conv_crop
  from coremltools.models import MLModel
  from coremltools.models import neural_network
  from coremltools.models.neural_network.printer import print_network_spec
  from coremltools.models.utils import _macos_version
label_desc: Use image node_id 6 for calling the MLModelPassesTest obj's underlying member method code with example usage: obj.test_conv_crop_bn_relu_to_conv_bn_relu_crop() without return types