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/9379 Add cudnn activation ops Reviewed By: houseroad Differential Revision: D8818013 fbshipit-source-id: d3881c634a46578b9331da07f9fdf7e1f31d7e8a
31 lines
624 B
C++
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_
|