pytorch/caffe2/operators/relu_op.h
Xiaomeng Yang bb9ff58c6d Add cudnn activation ops (#9379)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/9379

Add cudnn activation ops

Reviewed By: houseroad

Differential Revision: D8818013

fbshipit-source-id: d3881c634a46578b9331da07f9fdf7e1f31d7e8a
2018-07-12 23:18:56 -07:00

31 lines
624 B
C++

#ifndef CAFFE2_OPERATORS_RELU_OP_H_
#define CAFFE2_OPERATORS_RELU_OP_H_
#include <vector>
#include "caffe2/operators/elementwise_ops.h"
namespace caffe2 {
template <class Context>
struct ReluFunctor {
template <typename T>
bool operator()(const int N, const T* X, T* Y, Context* context) const;
};
template <class Context>
struct ReluGradientFunctor {
template <typename T>
bool Forward(
const std::vector<int>& Y_dims,
const std::vector<int>& dY_dims,
const T* Y,
const T* dY,
T* dX,
Context* context) const;
};
} // namespace caffe2
#endif // CAFFE2_OPERATORS_RELU_OP_H_