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

Method testCos

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

Source from the content-addressed store, hash-verified

262 ]
263
264 def testCos(self):
265 for input_size in self.test_configs:
266 op = core.CreateOperator("Cos", ["X"], ["Y"])
267 X = np.random.rand(*input_size).astype(np.float32) - 0.5
268 res = device_checker.CheckSimple(op, [X], [0])
269 self.assertTrue(res)
270 for checker in gradient_checkers:
271 res, grad, grad_estimated = checker.CheckSimple(op, [X], 0, [0])
272 self.assertTrue(res)
273
274class TestSin(test_util.TestCase):
275

Callers

nothing calls this directly

Calls 3

astypeMethod · 0.80
randMethod · 0.45
CheckSimpleMethod · 0.45

Tested by

no test coverage detected