MCPcopy Index your code
hub / github.com/pytorch/pytorch / test_executor

Method test_executor

caffe2/python/test/executor_test.py:32–47  ·  view source on GitHub ↗
(self, executor, model_name, batch_size, num_workers)

Source from the content-addressed store, hash-verified

30 num_workers=st.sampled_from([8]))
31 @executor_test_settings
32 def test_executor(self, executor, model_name, batch_size, num_workers):
33 model = build_conv_model(model_name, batch_size)
34 model.Proto().num_workers = num_workers
35
36 def run_model():
37 iterations = ITERATIONS
38 if model_name == "MLP":
39 iterations = 1 # avoid numeric instability with MLP gradients
40 workspace.RunNet(model.net, iterations)
41
42 self.compare_executors(
43 model,
44 ref_executor="simple",
45 test_executor=executor,
46 model_run_func=run_model,
47 )
48
49
50@unittest.skipIf(not workspace.has_gpu_support, "no gpu")

Callers

nothing calls this directly

Calls 3

build_conv_modelFunction · 0.90
compare_executorsMethod · 0.80
ProtoMethod · 0.45

Tested by

no test coverage detected