-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Sparse】add new API/OP(csr->csr) of SparseTensor softmax #43475
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
07ca144
to
dfea25f
Compare
dfea25f
to
6609de1
Compare
6609de1
to
eeb47d7
Compare
eeb47d7
to
05ff4c6
Compare
05ff4c6
to
82c36b6
Compare
82c36b6
to
4f42055
Compare
4f42055
to
902fc81
Compare
902fc81
to
b5a86d1
Compare
b5a86d1
to
4fad3e7
Compare
auto functor = phi::funcs::CudaExpFunctor<T>(); | ||
out_values[row_first + idx] = | ||
functor(x_values[row_first + idx] - row_max_val); | ||
exp_sum += functor(x_values[row_first + idx] - row_max_val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T exp = functor(x_values[row_first + idx] - row_max_val);
out_values[row_first + idx] = exp;
exp_sum += exp;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thx~
sparse softmax activation, x must be SparseCsrTensor or SparseCooTensor. | ||
|
||
Note: | ||
Only supported axis=-1 for SparseCsrTensor, which is faster when read data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only support axis=-1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported写错了,应该是support,下个PR改下哈
…e#43475) * add new API/OP(csr->csr) of SparseTensor softmax * fix comment
PR types
New features
PR changes
OPs
Describe
新增稀疏Tensor激活函数
paddle.incubate.sparse.nn.Softmax
与paddle.incubate.sparse.nn.functional.softmax
paddle.incubate.sparse.nn.Softmax
paddle.incubate.sparse.nn.functional.softmax