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

Method test_net_create

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

Source from the content-addressed store, hash-verified

587 value=st.floats(min_value=-1, max_value=1.0),
588 )
589 def test_net_create(self, blob_name, net_name, value):
590 ws = workspace.C.Workspace()
591 net = core.Net(net_name)
592 net.ConstantFill([], [blob_name], shape=[1], value=value)
593 ws.create_net(net).run()
594 self.assertIn(blob_name, ws.blobs)
595 self.assertIn(net.Name(), ws.nets)
596 np.testing.assert_allclose(
597 [value], ws.blobs[blob_name].fetch(), atol=1e-4, rtol=1e-4
598 )
599
600 @given(
601 name=st.text(),

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected