def _bin_op(tf_fun, a, b, promote=True): if promote: a, b = np_array_ops._promote_dtype_binary(a, b) # pylint: disable=protected-access else: a = np_array_ops.array(a) b = np_array_ops.array(b) return tf_fun(a, b)
def _bin_op(tf_fun, a, b, promote=True): if promote: a, b = np_array_ops._promote_dtype_binary(a, b) # pylint: disable=protected-access else: a = np_array_ops.array(a) b = np_array_ops.array(b) return np_utils.tensor_to_ndarray(tf_fun(a.data, b.data))