"src/diffusers/pipelines/controlnet/pipeline_controlnet.py" did not exist on "57f7d2593427bd2cbf7d15d32844cfc5f7717d3f"
spspmm.h 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
/**
 *  Copyright (c) 2022 by Contributors
 * @file sparse/spspmm.h
 * @brief DGL C++ SpSpMM operator.
 */
#ifndef SPARSE_SPSPMM_H_
#define SPARSE_SPSPMM_H_

#include <sparse/sparse_matrix.h>
10
#include <torch/script.h>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

namespace dgl {
namespace sparse {

/**
 * @brief Perform a sparse-sparse matrix multiplication on matrices with
 * possibly different sparsities. The two sparse matrices must have
 * 1-D values. If the first sparse matrix has shape (n, m), the second
 * sparse matrix must have shape (m, k), and the returned sparse matrix has
 * shape (n, k).
 *
 * This function supports autograd for both sparse matrices but does
 * not support higher order gradient.
 *
 * @param lhs_mat The first sparse matrix of shape (n, m).
 * @param rhs_mat The second sparse matrix of shape (m, k).
 *
 * @return Sparse matrix of shape (n, k).
 */
c10::intrusive_ptr<SparseMatrix> SpSpMM(
    const c10::intrusive_ptr<SparseMatrix>& lhs_mat,
    const c10::intrusive_ptr<SparseMatrix>& rhs_mat);

}  // namespace sparse
}  // namespace dgl

#endif  // SPARSE_SPSPMM_H_