[XLA] Add another test case for complex division

PiperOrigin-RevId: 306861383
Change-Id: I0309309e4ea0162881fc819188f2fa042cf7ae9d
This commit is contained in:
David Majnemer 2020-04-16 09:29:05 -07:00 committed by TensorFlower Gardener
parent 380feaac4d
commit 7c0fea00eb

View File

@ -521,10 +521,18 @@ class BinaryOpsTest(xla_test.XLATestCase):
self._testBinary(
gen_math_ops.real_div,
np.array([3, 3j, -1.5j, -8, 2 + 3j, 2 + 4j], dtype=dtype),
np.array([2, -2, 7j, -4j, 4 - 6j, 1 + 2j], dtype=dtype),
expected=np.array(
[1.5, -1.5j, -0.2142857, -2j, (2 + 3j) / (4 - 6j), 2],
np.array(
[3, 3j, -1.5j, -8, 2 + 3j, 2 + 4j, 9.663546088957395e-28 + 0j],
dtype=dtype),
np.array([
2, -2, 7j, -4j, 4 - 6j, 1 + 2j,
9.39511792677288e-16 - 1.529841108938729e-23j
],
dtype=dtype),
expected=np.array([
1.5, -1.5j, -0.2142857, -2j,
(2 + 3j) / (4 - 6j), 2, 1.028571e-12 + 1.674859e-20j
],
dtype=dtype))
self._testBinary(