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

Function _mul_dispatch

tensorflow/python/ops/math_ops.py:1202–1211  ·  view source on GitHub ↗

Dispatches cwise mul for "Dense*Dense" and "Dense*Sparse".

(x, y, name=None)

Source from the content-addressed store, hash-verified

1200
1201
1202def _mul_dispatch(x, y, name=None):
1203 """Dispatches cwise mul for "Dense*Dense" and "Dense*Sparse"."""
1204 is_tensor_y = isinstance(y, ops.Tensor)
1205 if is_tensor_y:
1206 return gen_math_ops.mul(x, y, name=name)
1207 else:
1208 assert isinstance(y, sparse_tensor.SparseTensor) # Case: Dense * Sparse.
1209 new_vals = gen_sparse_ops.sparse_dense_cwise_mul(y.indices, y.values,
1210 y.dense_shape, x, name)
1211 return sparse_tensor.SparseTensor(y.indices, new_vals, y.dense_shape)
1212
1213
1214# NOTE(aselle): When integer division is added for sparse_dense_cwise,

Callers

nothing calls this directly

Calls 1

mulMethod · 0.45

Tested by

no test coverage detected