Skip to content

Commit

Permalink
Use testing new testing infra from external codegen
Browse files Browse the repository at this point in the history
After introducing the new testing infrastructure into the external
codegen I didn't copy it into the target hooks which meant it started
failing.
  • Loading branch information
Mousius committed Jul 13, 2021
1 parent 89bbb8a commit 011ebc9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/python/relay/test_additional_target_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
import tvm.relay.transform

from tvm import relay
from test_external_codegen import set_external_func_attr, check_result
from test_external_codegen import (
set_external_func_attr,
check_vm_result,
check_aot_executor_result,
check_graph_executor_result,
)


def translate_relay_add_to_tir_subtract(relay_func):
def translate_relay_add_to_tir_subtract():
"""A transform to test Relay -> TIR with"""
ib = tvm.tir.ir_builder.create()
A = tvm.tir.decl_buffer(
Expand Down Expand Up @@ -58,7 +63,10 @@ def translate_relay_add_to_tir_subtract(relay_func):
return ir


def test_tir_external_generation():
@pytest.mark.parametrize(
"check_result", [check_vm_result, check_graph_executor_result, check_aot_executor_result]
)
def test_tir_external_generation(check_result):
@tvm.register_func("target.test.tir_lowering")
def relay_to_tir(expr, target):
return translate_relay_add_to_tir_subtract(expr)
Expand Down

0 comments on commit 011ebc9

Please sign in to comment.