code: def test_tflite_model_u4_usecase_two_external_pools(
      model_url, usmp_algo
  ):
      """This checks for inference with USMP using external pool placed in the application"""
      pytest.importorskip("tflite")
  
      import tvm.relay.testing.tf as tf_testing  # pylint: disable=import-outside-toplevel
  
      use_unpacked_api = True
      interface_api = "c"
  
      target = tvm.target.Target("c")
      workspace_memory_pools = WorkspaceMemoryPools(
          [
              WorkspacePoolInfo(
                  "my_memory_pool_1",
                  [target],
                  PoolInfoProperties(size_hint_bytes=2500000),
              ),
              WorkspacePoolInfo("my_memory_pool_2", [target]),
          ]
      )
  
      tflite_model_file = tf_testing.get_workload_official(
          model_url[0],
          model_url[1],
      )
      (
          mod,
          inputs,
          params,
      ) = create_relay_module_and_inputs_from_tflite_file(
          tflite_model_file
      )
      output_list = generate_ref_data(mod, inputs, params)
  
      input_name, input_data = list(inputs.items())[0]
      input_size_bytes = input_data.size * input_data.itemsize
      test_runner = AOTTestRunner(
          pass_config={
              "tir.usmp.enable": True,
              "tir.usmp.algorithm": usmp_algo,
              "tir.usmp.use_workspace_io": True,
          },
          prologue=f"""
          #include <string.h>
          __attribute__((section(".data.tvm"), aligned(16)))
          static uint8_t my_memory_pool_1[{_get_workspace_size_define_macro("my_memory_pool_1")}];
          __attribute__((section(".data.tvm"), aligned(16)))
          static uint8_t my_memory_pool_2[{_get_workspace_size_define_macro("my_memory_pool_2")}];
          struct {_add_module_prefix("workspace_pools")} {_add_module_prefix("workspace_pools")} = {{
              .my_memory_pool_1 = my_memory_pool_1,
              .my_memory_pool_2 = my_memory_pool_2,
          }};
          struct {_add_module_prefix("inputs")} {_add_module_prefix("inputs")} = {_add_module_prefix("map_inputs")}(&{_add_module_prefix("workspace_pools")});
          memcpy({_add_module_prefix("inputs")}.{input_name}, tvmgen_default_input_data_input, {input_size_bytes});
          struct {_add_module_prefix("outputs")} {_add_module_prefix("outputs")} = {_add_module_prefix("map_outputs")}(&{_add_module_prefix("workspace_pools")});
          """,
      )
  
      compiled_test_mods = compile_models(
          AOTTestModel(
              module=mod,
              inputs=inputs,
              outputs=output_list,
              params=params,
          ),
          interface_api=interface_api,
          use_unpacked_api=use_unpacked_api,
          pass_config=test_runner.pass_config,
          workspace_memory_pools=workspace_memory_pools,
          target=target,
      )
  
      for compiled_model in compiled_test_mods:
          _check_for_no_tvm_backendallocworkspace_calls(
              compiled_model.executor_factory.lib
          )
  
      run_and_check(
          models=compiled_test_mods,
          runner=test_runner,
          interface_api=interface_api,
          use_workspace_io=True,
      )
  
imports: from collections import OrderedDict
  import re
  import random
  import numpy
  import pytest
  import tvm
  from tvm import relay
  from tvm.relay import testing
  from tvm.relay import transform
  from tvm.relay.op.annotation import compiler_begin, compiler_end
  from tvm.relay.backend import Executor, Runtime
  from tvm import WorkspaceMemoryPools, ConstantMemoryPools, WorkspacePoolInfo, ConstantPoolInfo, PoolInfoProperties
  from tvm.micro import model_library_format
  from tvm.micro.testing.aot_test_utils import parametrize_aot_options
  from tvm.testing.aot import AOTTestModel, AOTTestRunner, generate_ref_data, compile_and_run, compile_models, run_and_check, create_relay_module_and_inputs_from_tflite_file
  from tvm.testing.usmp import is_tvm_backendallocworkspace_calls
label_desc: Use image node_id 17 for calling a global function with example usage: test_tflite_model_u4_usecase_two_external_pools(model_url, usmp_algo) without return types