提交 2917a75b 编写于 作者: Y Yancey1989

add some comments for sparse table

上级 ca327508
...@@ -24,6 +24,22 @@ namespace paddle { ...@@ -24,6 +24,22 @@ namespace paddle {
namespace framework { namespace framework {
class SelectedRows { class SelectedRows {
/*
* @brief We can use the SelectedRows structure to reproduce a sparse table.
* A sparse table is a key-value structure that the key is an `int64_t`
* number,
* and the value is a Tensor which the first dimension is 0.
* You can use the following interface to operate the sparse table, and you
* can find
* some detail information from the comments of each interface:
*
* HasKey(key), whether the sparse table has the specified key.
* Set(key, value), set a key-value pair into the sparse table.
* Get(key, value*, offset), get a value by key and apply it to the given
* value pointer
* with the specified offset.
*
*/
public: public:
SelectedRows(const std::vector<int64_t>& rows, const int64_t& height) SelectedRows(const std::vector<int64_t>& rows, const int64_t& height)
: rows_(rows), height_(height) { : rows_(rows), height_(height) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册