(self, x)
| 43 | class PythonOpTest(hu.HypothesisTestCase): |
| 44 | @given(x=hu.tensor()) |
| 45 | def test_feed(self, x): |
| 46 | def f(inputs, _): |
| 47 | self.assertEqual(x.shape, inputs[0].shape) |
| 48 | self.assertEqual(type(inputs[0].shape), tuple) |
| 49 | self.assertEqual(type(inputs[0].data), np.ndarray) |
| 50 | np.testing.assert_almost_equal(x, inputs[0].data) |
| 51 | op = CreatePythonOperator(f, ["x"], []) |
| 52 | workspace.FeedBlob("x", x) |
| 53 | workspace.RunOperatorOnce(op) |
| 54 | |
| 55 | def test_exception(self): |
| 56 | op = CreatePythonOperator(MainOpFunctionThatThrowsCustomError, [], []) |
nothing calls this directly
no test coverage detected