code: def test_conv2d_double_cascade(trial):
      def _get_func(
          ifm_shape,
          ifm_channels,
          mid_channels,
          ofm_channels,
          kernel_shape,
          padding,
          strides,
          dilation,
          layout,
          upscale,
      ):
          ifm = relay.var("ifm", shape=ifm_shape, dtype="int8")
          conv1 = make_ethosu_conv2d(
              ifm,
              ifm_channels,
              mid_channels,
              kernel_shape,
              padding,
              strides,
              dilation,
              activation="NONE",
              ifm_layout=layout,
              ofm_layout=layout,
              upscale=upscale,
          )
          conv2 = make_ethosu_conv2d(
              conv1,
              mid_channels,
              ofm_channels,
              kernel_shape,
              padding,
              strides,
              dilation,
              activation="NONE",
              ifm_layout=layout,
              ofm_layout=layout,
              upscale=upscale,
          )
          func = relay.Function(relay.analysis.free_vars(conv2), conv2)
          func = run_opt_pass(func, relay.transform.InferType())
          return func
  
      reference_mod = trial[0]
      params = trial[1:]
      config = {
          "enable_cascader": True,
      }
      with tvm.transform.PassContext(
          opt_level=3, config={"relay.ext.ethos-u.options": config}
      ):
          func = _get_func(*params[:-1])
          mod, _ = _lower_to_tir(
              func, cascader=total_cascader(params[-1])
          )
          script = mod.script()
          mod = tvm.script.from_source(script)
          tvm.ir.assert_structural_equal(
              mod["main"], reference_mod["main"], True
          )
  
imports: import pytest
  import tvm
  from tvm import relay
  from tvm.relay.backend.contrib.ethosu.tir.compiler import _lower_to_tir
  from tvm.relay.backend.contrib.ethosu.tir.scheduler import total_cascader
  from tvm.relay.testing import run_opt_pass
  from tvm.script import tir
  from .infra import make_ethosu_conv2d
label_desc: Use image node_id 4 for calling a global function with example usage: test_conv2d_double_cascade(trial) and returns: func