(self)
| 340 | rtol=1e-14) |
| 341 | |
| 342 | def testPow(self): |
| 343 | for dtype in self.float_types: |
| 344 | rtol = 1e-14 if dtype == np.float64 else None |
| 345 | |
| 346 | self._testBinary( |
| 347 | math_ops.pow, |
| 348 | dtype(3), |
| 349 | dtype(4), |
| 350 | expected=dtype(81), |
| 351 | rtol=rtol) |
| 352 | |
| 353 | self._testBinary( |
| 354 | math_ops.pow, |
| 355 | np.array([1, 2], dtype=dtype), |
| 356 | np.zeros(shape=[0, 2], dtype=dtype), |
| 357 | expected=np.zeros(shape=[0, 2], dtype=dtype), |
| 358 | rtol=rtol) |
| 359 | self._testBinary( |
| 360 | math_ops.pow, |
| 361 | np.array([10, 4], dtype=dtype), |
| 362 | np.array([2, 3], dtype=dtype), |
| 363 | expected=np.array([100, 64], dtype=dtype), |
| 364 | rtol=rtol) |
| 365 | self._testBinary( |
| 366 | math_ops.pow, |
| 367 | dtype(2), |
| 368 | np.array([3, 4], dtype=dtype), |
| 369 | expected=np.array([8, 16], dtype=dtype), |
| 370 | rtol=rtol) |
| 371 | self._testBinary( |
| 372 | math_ops.pow, |
| 373 | np.array([[2], [3]], dtype=dtype), |
| 374 | dtype(4), |
| 375 | expected=np.array([[16], [81]], dtype=dtype), |
| 376 | rtol=rtol) |
| 377 | |
| 378 | def testNumericOps(self): |
| 379 | for dtype in self.numeric_types: |
nothing calls this directly
no test coverage detected