pytorch/caffe2/operators/sqrt_op.h
Xiaomeng Yang 598b713660 Seperate level1 elementwise functions from math (#16397)
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
2019-01-30 00:04:12 -08:00

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_