(self, np_features, approximate=False, use_gpu=False)
| 39 | return x * norm.cdf(x) |
| 40 | |
| 41 | def _testGelu(self, np_features, approximate=False, use_gpu=False): |
| 42 | expected_values = self._npGelu(np_features, approximate) |
| 43 | with self.cached_session(use_gpu=use_gpu): |
| 44 | results = self.evaluate(nn_ops.gelu(np_features, approximate)) |
| 45 | self.assertAllCloseAccordingToType(expected_values, results) |
| 46 | |
| 47 | def testNumbers(self): |
| 48 | for approximate in [False, True]: |
no test coverage detected