

def dot(x, y):
    '\n    Operation for efficiently calculating the dot product when\n    one or all operands is sparse. Supported format are CSC and CSR.\n    The output of the operation is dense.\n\n    Parameters\n    ----------\n    x\n        Sparse or dense matrix variable.\n    y\n        Sparse or dense matrix variable.\n\n    Returns\n    -------\n    The dot product `x`.`y` in a dense format.\n\n    Notes\n    -----\n    The grad implemented is regular, i.e. not structured.\n\n    At least one of `x` or `y` must be a sparse matrix.\n\n    When the operation has the form dot(csr_matrix, dense)\n    the gradient of this operation can be performed inplace\n    by UsmmCscDense. This leads to significant speed-ups.\n\n    '
    if hasattr(x, 'getnnz'):
        x = as_sparse_variable(x)
    if hasattr(y, 'getnnz'):
        y = as_sparse_variable(y)
    x_is_sparse_variable = _is_sparse_variable(x)
    y_is_sparse_variable = _is_sparse_variable(y)
    if ((not x_is_sparse_variable) and (not y_is_sparse_variable)):
        raise TypeError()
    return _dot(x, y)

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py dot/original