-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【complex op No.10】sqrt #68149
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
【complex op No.10】sqrt #68149
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
struct SqrtFunctor<ComplexType<T>> : public BaseActivationFunctor<T> { | ||
template <typename Device, typename X, typename Out> | ||
void operator()(Device d, X x, Out out) const { | ||
out.device(d) = x.sqrt(); |
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.
这个跟上面的不带complex的运算逻辑一样,是否还需要单独特化一个struct
@@ -759,6 +767,23 @@ struct SqrtGradFunctor : public BaseActivationFunctor<T> { | |||
} | |||
}; | |||
|
|||
template <typename T> | |||
struct SqrtGradFunctor<ComplexType<T>> : public BaseActivationFunctor<T> { |
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.
改为BaseActivationFunctor<ComplexType>会不会好些
self.dtype = np.complex64 | ||
|
||
def test_check_output(self): | ||
pass |
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.
这个函数不需要运行么
Sorry to inform you that 501e467's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR Category
Operator Mechanism
PR Types
New features
Description
add complex support for sqrt