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

Method test_run

caffe2/python/predictor/predictor_test.py:57–63  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

55 return net.SerializeToString()
56
57 def test_run(self):
58 A = np.ones((2, 3), np.float32)
59 B = np.ones((3, 4), np.float32)
60 predictor = workspace.Predictor(self.init_net, self.predict_net)
61 outputs = predictor.run([A, B])
62 self.assertEqual(len(outputs), 1)
63 np.testing.assert_almost_equal(np.dot(A, B), outputs[0])
64
65 def test_run_map(self):
66 A = np.zeros((2, 3), np.float32)

Callers

nothing calls this directly

Calls 4

dotMethod · 0.80
onesMethod · 0.45
runMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected