mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16397 Seperate level1 elementwise functions from math i-am-not-moving-c2-to-c10 Reviewed By: houseroad Differential Revision: D13830626 fbshipit-source-id: e6e672647076dab8b3b24be181f580a1486250c9
21 lines
448 B
C++
21 lines
448 B
C++
#ifndef CAFFE2_OPERATORS_SQRT_OP_H_
|
|
#define CAFFE2_OPERATORS_SQRT_OP_H_
|
|
|
|
#include "caffe2/operators/elementwise_ops.h"
|
|
#include "caffe2/utils/math.h"
|
|
|
|
namespace caffe2 {
|
|
|
|
template <class Context>
|
|
struct SqrtFunctor {
|
|
template <typename T>
|
|
bool operator()(const int N, const T* X, T* Y, Context* context) const {
|
|
math::Sqrt<T, Context>(N, X, Y, context);
|
|
return true;
|
|
}
|
|
};
|
|
|
|
} // namespace caffe2
|
|
|
|
#endif // CAFFE2_OPERATORS_SQRT_OP_H_
|