pytorch/caffe2/operators/quantile_op.cc
Nikita Shulga a9b0a921d5 Disable avoid-non-const-global-variables lint check (#62008)
Summary:
As GoogleTest `TEST` macro is non-compliant with it as well as `DEFINE_DISPATCH`

All changes but the ones to `.clang-tidy` are generated using following script:
```
for i in `find . -type f -iname "*.c*" -or -iname "*.h"|xargs grep cppcoreguidelines-avoid-non-const-global-variables|cut -f1 -d:|sort|uniq`;  do sed -i "/\/\/ NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)/d" $i; done
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/62008

Reviewed By: driazati, r-barnes

Differential Revision: D29838584

Pulled By: malfet

fbshipit-source-id: 1b2f8602c945bd4ce50a9bfdd204755556e31d13
2021-07-22 18:04:40 -07:00

19 lines
614 B
C++

#include "quantile_op.h"
namespace caffe2 {
REGISTER_CPU_OPERATOR(Quantile, QuantileOp<CPUContext>);
OPERATOR_SCHEMA(Quantile)
.NumInputs(1, INT_MAX)
.NumOutputs(1)
.SetDoc(R"DOC(
Calculate the quantile for the value in the given list of tensors.
)DOC")
.Input(0, "X1, X2, ...", "*(type: Tensor`<float>`)* List of input tensors.")
.Output(0, "quantile_value", "Value at the given quantile")
.Arg("abs", "If true (default), apply abs() on the tensor values.")
.Arg("tol", "multiplicative tolerance of the quantile_value.");
SHOULD_NOT_DO_GRADIENT(Quantile);
} // namespace caffe2