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

Method test_plan_run

caffe2/python/workspace_test.py:569–582  ·  view source on GitHub ↗
(self, blob_name, plan_name, net_name, value)

Source from the content-addressed store, hash-verified

567 value=st.floats(min_value=-1, max_value=1.0),
568 )
569 def test_plan_run(self, blob_name, plan_name, net_name, value):
570 ws = workspace.C.Workspace()
571 plan = core.Plan(plan_name)
572 net = core.Net(net_name)
573 net.ConstantFill([], [blob_name], shape=[1], value=value)
574
575 plan.AddStep(core.ExecutionStep("step", nets=[net], num_iter=1))
576
577 ws.run(plan)
578 self.assertIn(blob_name, ws.blobs)
579 self.assertIn(net.Name(), ws.nets)
580 np.testing.assert_allclose(
581 [value], ws.blobs[blob_name].fetch(), atol=1e-4, rtol=1e-4
582 )
583
584 @given(
585 blob_name=st.text(),

Callers

nothing calls this directly

Calls 5

AddStepMethod · 0.95
NameMethod · 0.95
NetMethod · 0.80
runMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected