code: def test_pool2d(target, schedule_func, monkeypatch):
      target = tvm.target.Target(target)
  
      data_shape = (1, 2, 2, 4)
      dtype = "float32"
  
      out = relay.nn.avg_pool2d(
          relay.var("data", shape=data_shape, dtype=dtype)
      )
      placeholders = [te.placeholder(data_shape, dtype)]
  
      mock_schedule = MagicMock()
      monkeypatch.setattr(schedule_func, "schedule_pool", mock_schedule)
  
      # Since pool does not use OpStrategy to determine the relevant schedule,
      # we cannot simply check the schedule name that was selected with
      # `select_implementation`. With this implementation of schedule selection,
      # "pool.arm_cpu" will always be the schedule name, regardless of what schedule
      # was selected. Instead, this test checks that the relevant schedule function
      # is called when selecting the pooling from schedule from arm_cpu.
      relay.op.strategy.arm_cpu.schedule_pool_arm_cpu(
          out.attrs, placeholders, target
      )
      mock_schedule.assert_called()
  
file_path: tvm/tests/python/relay/strategy/test_select_implementation.py
imports: import pytest
  import numpy
  from unittest.mock import MagicMock
  import tvm
  from tvm import relay
  from tvm import te
  from tvm.relay.testing import run_infer_type, run_opt_pass
  import tvm.testing
  from tvm import topi
label_desc: Use image node_id 8 for calling a global function with example usage: test_pool2d(target, schedule_func, monkeypatch) without return types