code: def test_get_valid_implementations():
      target = tvm.target.Target("llvm")
  
      def _get_impls(dshape, wshape):
          data = relay.var("data", shape=dshape)
          weight = relay.var("wshape", shape=wshape)
          out = relay.nn.conv2d(data, weight, padding=(1, 1))
          out = run_infer_type(out)
          return relay.backend.te_compiler.get_valid_implementations(
              relay.op.get("nn.conv2d"),
              out.attrs,
              [te.placeholder(dshape), te.placeholder(wshape)],
              out.checked_type,
              target,
          )
  
      with TempOpAttr("nn.conv2d", "FTVMStrategy", _tmp_strategy):
          impls = _get_impls((1, 8, 7, 7), (32, 8, 3, 3))
          assert len(impls) == 2
          impls = _get_impls((1, 16, 7, 7), (32, 16, 3, 3))
          assert len(impls) == 3
  
imports: import numpy
  import tvm
  from tvm import te
  import tvm.testing
  from tvm import relay
  from tvm import autotvm
  from tvm import topi
  from tvm.relay.backend import te_compiler
  from tvm.relay.testing import run_infer_type
  from tvm.relay.testing.temp_op_attr import TempOpAttr
label_desc: Use image node_id 9 for calling a global function with example usage: test_get_valid_implementations() and returns: relay