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

Method test_operator_run

caffe2/python/workspace_test.py:538–545  ·  view source on GitHub ↗
(self, name, value)

Source from the content-addressed store, hash-verified

536
537 @given(name=st.text(), value=st.floats(min_value=-1, max_value=1.0))
538 def test_operator_run(self, name, value):
539 ws = workspace.C.Workspace()
540 op = core.CreateOperator("ConstantFill", [], [name], shape=[1], value=value)
541 ws.run(op)
542 self.assertIn(name, ws.blobs)
543 np.testing.assert_allclose(
544 [value], ws.blobs[name].fetch(), atol=1e-4, rtol=1e-4
545 )
546
547 @given(
548 blob_name=st.text(),

Callers

nothing calls this directly

Calls 2

runMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected