code: def test_multiple_requantize_offload():
      """
      Testing requantize offload in the case one requantize operation is part of
      an existing pattern (in this case Mean: cast->mean->requantize) and the
      other is a stand-alone requantize.
      """
  
      def create_model():
          ifm = relay.var("input", shape=(1, 3, 3, 4), dtype="int8")
          cast = relay.cast(ifm, dtype="int32")
          mean = relay.mean(cast, axis=1, keepdims=True)
          requantize = relay.qnn.op.requantize(
              mean,
              input_scale=relay.const(1.0, dtype="float32"),
              input_zero_point=relay.const(0, dtype="int32"),
              output_scale=relay.const(1.0, dtype="float32"),
              output_zero_point=relay.const(0, dtype="int32"),
          )
          requantize = relay.qnn.op.requantize(
              requantize,
              input_scale=relay.const(1.0, dtype="float32"),
              input_zero_point=relay.const(0, dtype="int32"),
              output_scale=relay.const(1.0, dtype="float32"),
              output_zero_point=relay.const(0, dtype="int32"),
          )
          return tvm.IRModule.from_expr(
              relay.Function([ifm], requantize)
          )
  
      def verify(ext_func):
          # If mean operation and separate requantize were offloaded correctly,
          # there should only be a pooling operation followed by an identity
          # operation leagalized.
          op = ext_func.body
          assert op.op.name == "contrib.ethosu.identity"
          op = op.args[0]
          assert (
              ext_func.body.args[0].op.name == "contrib.ethosu.pooling"
          )
          op = op.args[0]
          assert isinstance(op, relay.Var)
  
      mod = create_model()
      mod = ethosu.partition_for_ethosu(mod)
      mod = legalize.LegalizeEthosU()(mod)
      verify(mod["tvmgen_default_ethos_u_main_0"])
  
imports: import pytest
  import math
  import numpy
  import tensorflow
  import tflite.Model
  import tvm
  from tvm import relay
  from tvm.relay.backend.contrib.ethosu import legalize, preprocess
  from tvm.relay import dataflow_pattern
  from tvm.relay.op.contrib import ethosu
  from tvm.relay.backend.contrib.ethosu import util, codegen
  from tvm.relay.build_module import bind_params_by_name
  from tvm.relay.frontend.tflite import get_pad_value
  from tvm.relay.expr_functor import ExprVisitor
  from .None import infra
label_desc: Use image node_id 30 for calling a global function with example usage: test_multiple_requantize_offload() and returns: tvm