项目文件夹

文件
Mufei Li 0f1bcd9927 [Sparse] Softmax based on Reduction and BroadcastOp (#5067)
* Update

* update

* Update

* Update

* Update

* format

* Update

* lint

* Update

* lint

* CI

* CI

* Update

* address comments

Co-authored-by: Ubuntu <ubuntu@ip-172-31-36-188.ap-northeast-1.compute.internal>
2022-12-27 14:50:15 +08:00

31 行
673 B
C++

/**
* Copyright (c) 2022 by Contributors
* @file sparse/softmax.h
* @brief DGL C++ Softmax operator
*/
#ifndef SPARSE_SOFTMAX_H_
#define SPARSE_SOFTMAX_H_
#include <sparse/sparse_matrix.h>
namespace dgl {
namespace sparse {
/**
* @brief Apply row-wise softmax to the non-zero entries of the sparse matrix.
*
* This function supports autograd for the sparse matrix, but it does not
* support higher order gradient.
*
* @param sparse_mat The sparse matrix
*
* @return Sparse matrix
*/
c10::intrusive_ptr<SparseMatrix> Softmax(
const c10::intrusive_ptr<SparseMatrix>& sparse_mat);
} // namespace sparse
} // namespace dgl
#endif // SPARSE_SOFTMAX_H_