MCPcopy Create free account
hub / github.com/apache/tvm / test_execute

Function test_execute

tests/python/relax/test_training_trainer_numeric.py:57–77  ·  view source on GitHub ↗
(target, dev)

Source from the content-addressed store, hash-verified

55
56@tvm.testing.parametrize_targets("llvm")
57def test_execute(target, dev):
58 backbone = _get_backbone()
59 pred_sinfo = relax.TensorStructInfo((1, 5), "float32")
60
61 setup_trainer = SetupTrainer(
62 MSELoss(reduction="sum"),
63 Adam(0.01),
64 [pred_sinfo, pred_sinfo],
65 )
66
67 train_mod = setup_trainer(backbone)
68 ex = tvm.compile(train_mod, target)
69 vm = relax.VirtualMachine(ex, dev)
70
71 trainer = Trainer(train_mod, vm, dev, False)
72 trainer.zero_init_params()
73 trainer.xaiver_uniform_init_params()
74
75 dataset = _make_dataset()
76 trainer.predict(dataset[0][0])
77 trainer.update(dataset[0][0], dataset[0][1])
78
79
80@tvm.testing.parametrize_targets("llvm")

Callers

nothing calls this directly

Calls 11

zero_init_paramsMethod · 0.95
predictMethod · 0.95
updateMethod · 0.95
SetupTrainerClass · 0.90
MSELossClass · 0.90
AdamClass · 0.90
TrainerClass · 0.90
_get_backboneFunction · 0.85
_make_datasetFunction · 0.85
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…