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

Method test_reshape

caffe2/python/python_op_test.py:107–118  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

105
106 @given(x=hu.tensor())
107 def test_reshape(self, x):
108 def f(inputs, outputs):
109 outputs[0].reshape(inputs[0].shape)
110 self.assertEqual(x.shape, inputs[0].shape)
111 self.assertEqual(x.shape, outputs[0].shape)
112 outputs[0].data[...] = inputs[0].data
113
114 op = CreatePythonOperator(f, ["x"], ["y"])
115 workspace.FeedBlob("x", x)
116 workspace.RunOperatorOnce(op)
117 y = workspace.FetchBlob("y")
118 np.testing.assert_almost_equal(x, y)
119
120 @given(x=hu.tensor())
121 def test_workspace_manipulation(self, x):

Callers

nothing calls this directly

Calls 1

CreatePythonOperatorFunction · 0.90

Tested by

no test coverage detected