(self)
| 174 | ] |
| 175 | |
| 176 | def testRelu(self): |
| 177 | for input_size in self.test_configs: |
| 178 | op = core.CreateOperator("Relu", ["X"], ["Y"]) |
| 179 | X = np.random.rand(*input_size).astype(np.float32) |
| 180 | # go away from the origin point to avoid kink problems |
| 181 | X += 0.01 * np.sign(X) |
| 182 | X[X == 0] = 0.01 |
| 183 | res = device_checker.CheckSimple(op, [X], [0]) |
| 184 | self.assertTrue(res) |
| 185 | for checker in gradient_checkers: |
| 186 | res, grad, grad_estimated = checker.CheckSimple(op, [X], 0, [0]) |
| 187 | self.assertTrue(res) |
| 188 | |
| 189 | |
| 190 | class TestTanh(test_util.TestCase): |
nothing calls this directly
no test coverage detected