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

Method testFlatten

caffe2/python/gradient_check_test.py:94–101  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

92class TestFlatten(test_util.TestCase):
93
94 def testFlatten(self):
95 op = core.CreateOperator("Flatten", ["X"], ["Y"])
96 X = np.random.rand(2, 3, 4, 5).astype(np.float32)
97 res = device_checker.CheckSimple(op, [X], [0])
98 self.assertTrue(res)
99 for checker in gradient_checkers:
100 res, grad, grad_estimated = checker.CheckSimple(op, [X], 0, [0])
101 self.assertTrue(res)
102
103
104class TestConcat(test_util.TestCase):

Callers

nothing calls this directly

Calls 3

astypeMethod · 0.80
randMethod · 0.45
CheckSimpleMethod · 0.45

Tested by

no test coverage detected