Adding reciprocal operator and a test#9908
Conversation
caffe2/utils/math_cpu.cc
Outdated
|
|
||
| #define DELEGATE_INV_FUNCTION(T) \ | ||
| template <> \ | ||
| void Inv<T, CPUContext>(const int N, const T* x, T* y, CPUContext*) { \ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
caffe2/operators/reciprocal_op.cc
Outdated
| Argument scale_arg; | ||
| scale_arg.set_name("scale"); | ||
| scale_arg.set_f(0.5); | ||
| return std::vector<OperatorDef>{CreateOperatorDef( |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@pytorchbot test this please |
|
I found a problem with the test and working on it. |
|
@pytorchbot retest this please |
bddppq
left a comment
There was a problem hiding this comment.
re. the build error in pr/caffe2-py2-clang3.8-rocm1.7.1-ubuntu16.04-test, you would also need to add the math::Inv functions in caffe2/utils/hip/math_hip.cc
04:54:57 ../lib/libcaffe2_hip.so: undefined reference to `void caffe2::math::Inv<float, caffe2::HIPContext>(int, float const*, float*, caffe2::HIPContext*)'
|
|
||
| #define DELEGATE_INV_FUNCTION(T) \ | ||
| template <> \ | ||
| void Inv<T, CPUContext>(const int N, const T* x, T* y, CPUContext*) { \ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
BTW, we should create an internal diff, right? |
|
Thank you. Yes, I'll create it. |
|
You can just use "Import to Phabricator" button. Once internal tests passed, you may try to land it internally. And then the oss pr will be merged automatically. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
virtan has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Pull Request resolved: pytorch#9908 Differential Revision: D9035809 Pulled By: virtan fbshipit-source-id: bce1db46fd55faeeab18a3b266d25c8beeb08df7
Summary: Pull Request resolved: pytorch#9908 Differential Revision: D9035809 Pulled By: virtan fbshipit-source-id: bce1db46fd55faeeab18a3b266d25c8beeb08df7
No description provided.