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

Function _truediv_python3

tensorflow/python/ops/math_ops.py:989–1005  ·  view source on GitHub ↗
(x, y, name=None)

Source from the content-addressed store, hash-verified

987
988
989def _truediv_python3(x, y, name=None):
990 with ops.name_scope(name, "truediv", [x, y]) as name:
991 x = ops.convert_to_tensor(x, name="x")
992 y = ops.convert_to_tensor(y, name="y")
993 x_dtype = x.dtype.base_dtype
994 y_dtype = y.dtype.base_dtype
995 if x_dtype != y_dtype:
996 raise TypeError("x and y must have the same dtype, got %r != %r" %
997 (x_dtype, y_dtype))
998 try:
999 dtype = _TRUEDIV_TABLE[x_dtype]
1000 except KeyError:
1001 raise TypeError("Invalid dtype %r in __truediv__" % x_dtype)
1002 if dtype is not None:
1003 x = cast(x, dtype)
1004 y = cast(y, dtype)
1005 return gen_math_ops.real_div(x, y, name=name)
1006
1007
1008def _div_python2(x, y, name=None):

Callers 2

__truediv__Method · 0.85
truedivFunction · 0.85

Calls 2

castFunction · 0.70
name_scopeMethod · 0.45

Tested by

no test coverage detected