(self)
| 219 | ] |
| 220 | |
| 221 | def testAbs(self): |
| 222 | for input_size in self.test_configs: |
| 223 | op = core.CreateOperator("Abs", ["X"], ["Y"]) |
| 224 | X = np.random.rand(*input_size).astype(np.float32) |
| 225 | # go away from the origin point to avoid kink problems |
| 226 | X += 0.01 * np.sign(X) |
| 227 | X[X == 0] = 0.01 |
| 228 | res = device_checker.CheckSimple(op, [X], [0]) |
| 229 | self.assertTrue(res) |
| 230 | for checker in gradient_checkers: |
| 231 | res, grad, grad_estimated = checker.CheckSimple(op, [X], 0, [0]) |
| 232 | self.assertTrue(res) |
| 233 | |
| 234 | class TestExp(test_util.TestCase): |
| 235 |
nothing calls this directly
no test coverage detected