(self)
| 45 | self.assertAllCloseAccordingToType(expected_values, results) |
| 46 | |
| 47 | def testNumbers(self): |
| 48 | for approximate in [False, True]: |
| 49 | for t in [np.float16, np.float32, np.float64]: |
| 50 | self._testGelu( |
| 51 | np.array([[-9, 7, -5, 3, -1], [1, -3, 5, -7, 9]]).astype(t), |
| 52 | approximate, use_gpu=False) |
| 53 | self._testGelu( |
| 54 | np.array([[-9, 7, -5, 3, -1], [1, -3, 5, -7, 9]]).astype(t), |
| 55 | approximate, use_gpu=True) |
| 56 | |
| 57 | def testGradient(self): |
| 58 | with self.cached_session(): |