MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testMultiply

Method testMultiply

tensorflow/compiler/tests/binary_ops_test.py:315–340  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

313 dtype=dtype))
314
315 def testMultiply(self):
316 for dtype in self.numeric_types:
317 self._testBinary(
318 math_ops.multiply,
319 np.array([1, 20], dtype=dtype),
320 np.array([10, 2], dtype=dtype),
321 expected=np.array([10, 40], dtype=dtype))
322 self._testBinary(
323 math_ops.multiply,
324 dtype(5),
325 np.array([1, 20], dtype=dtype),
326 expected=np.array([5, 100], dtype=dtype))
327 self._testBinary(
328 math_ops.multiply,
329 np.array([[10], [2]], dtype=dtype),
330 dtype(7),
331 expected=np.array([[70], [14]], dtype=dtype))
332
333 if dtype not in self.int_types:
334 self._testBinary(
335 math_ops.multiply,
336 np.array([1.9131952969218875, 1.596299504298079], dtype=dtype),
337 np.array([1.1137667913355869, 1.7186636469261405], dtype=dtype),
338 expected=np.array([2.130853387051026, 2.743501927643327],
339 dtype=dtype),
340 rtol=1e-14)
341
342 def testPow(self):
343 for dtype in self.float_types:

Callers

nothing calls this directly

Calls 2

_testBinaryMethod · 0.95
dtypeFunction · 0.50

Tested by

no test coverage detected