Skip to content

Commit

Permalink
skip testing if target is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Dec 22, 2021
1 parent c9ebbe8 commit b53b2ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/python/frontend/pytorch/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ def verify_model(

with tvm.transform.PassContext(opt_level=3):
for target in ["llvm", "cuda"]:
if not tvm.runtime.enabled(target):
continue
dev = tvm.device(target, 0)
relay_graph, relay_lib, relay_params = relay.build(mod, target=target, params=params)
relay_model = graph_executor.create(relay_graph, relay_lib, dev)
Expand Down Expand Up @@ -2270,7 +2272,10 @@ def verify_model_vm(input_model, ishapes, idtype=None, idata=None, targets=["llv
mod, params = relay.frontend.from_pytorch(input_model, input_shapes)

for tgt in targets:
if not tvm.runtime.enabled(tgt):
continue
print("Running on target", tgt)

dev = tvm.device(tgt, 0)

evaluator = relay.create_executor("vm", mod=mod, device=dev, target=tgt).evaluate()
Expand Down

0 comments on commit b53b2ba

Please sign in to comment.