MCPcopy Create free account
hub / github.com/pytorch/pytorch / test_net_run

Method test_net_run

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

Source from the content-addressed store, hash-verified

550 value=st.floats(min_value=-1, max_value=1.0),
551 )
552 def test_net_run(self, blob_name, net_name, value):
553 ws = workspace.C.Workspace()
554 net = core.Net(net_name)
555 net.ConstantFill([], [blob_name], shape=[1], value=value)
556 ws.run(net)
557 self.assertIn(blob_name, ws.blobs)
558 self.assertNotIn(net_name, ws.nets)
559 np.testing.assert_allclose(
560 [value], ws.blobs[blob_name].fetch(), atol=1e-4, rtol=1e-4
561 )
562
563 @given(
564 blob_name=st.text(),

Callers

nothing calls this directly

Calls 3

NetMethod · 0.80
runMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected