pytorch/caffe2/quantization/server/relu_dnnlowp_op.h
Marc Fisher 9e60b00316 Remove AutoHeaders.RECURSIVE_GLOB from caffe2/ (#73227)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/73227

Reviewed By: christycylee

Differential Revision: D34016914

fbshipit-source-id: 277937f3c13a54ea1180afac253ee9927e56e99e
(cherry picked from commit d97777318170a406d89755e577386cde857dd59b)
2022-03-01 19:31:44 +00:00

32 lines
739 B
C++

#pragma once
#include "caffe2/operators/relu_op.h"
#include "caffe2/core/tensor_int8.h"
#include "caffe2/quantization/server/caffe2_dnnlowp_utils.h"
namespace caffe2 {
template <typename T>
class ReluDNNLowPOp final : public Operator<CPUContext> {
public:
USE_OPERATOR_FUNCTIONS(CPUContext);
ReluDNNLowPOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<CPUContext>(operator_def, ws),
qfactory_(dnnlowp::GetQuantizationFactoryOf(this)) {}
bool RunOnDevice() override;
private:
std::unique_ptr<dnnlowp::QuantizationFactory> qfactory_;
};
namespace internal {
template <typename T>
void ReluAVX2(const int N, const int zero_point, const T* X, T* Y);
} // namespace internal
} // namespace caffe2