def _mul_dispatch(x, y, name=None):
    'Dispatches cwise mul for "Dense*Dense" and "Dense*Sparse".'
    is_tensor_y = isinstance(y, ops.Tensor)
    if is_tensor_y:
        return gen_math_ops.mul(x, y, name=name)
    else:
        assert isinstance(y, sparse_tensor.SparseTensor)
        new_vals = gen_sparse_ops.sparse_dense_cwise_mul(y.indices, y.values, y.dense_shape, x, name)
        return sparse_tensor.SparseTensor(y.indices, new_vals, y.dense_shape)
Dispatches cwise mul for "Dense*Dense" and "Dense*Sparse".
def _mul_dispatch(x, y, name=None):
    
    is_tensor_y = isinstance(y, ops.Tensor)
    if is_tensor_y:
        return gen_math_ops.mul(x, y, name=name)
    else:
        assert isinstance(y, sparse_tensor.SparseTensor)
        new_vals = gen_sparse_ops.sparse_dense_cwise_mul(y.indices, y.values, y.dense_shape, x, name)
        return sparse_tensor.SparseTensor(y.indices, new_vals, y.dense_shape)