mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-27 17:54:55 +08:00
[clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841)
Summary: Add cppcoreguidelines-avoid-magic-numbers exclusion to clang-tidy Remove existing nolint warnings using following script: ``` for file in `git ls-files | grep -v \.py`; do gsed '/^ *\/\/ NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)/d' -i $file; done ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/57841 Reviewed By: samestep Differential Revision: D28295045 Pulled By: malfet fbshipit-source-id: 7c6e8d1213c9593f169ed3df6a916498f1a97163
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bc2540f0be
commit
3a66a1cb99
@ -31,7 +31,6 @@ TEST(CustomOperatorTest, InferredSchema) {
|
||||
ASSERT_EQ(op->schema().returns()[0].type()->kind(), TypeKind::TensorType);
|
||||
|
||||
Stack stack;
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
push(stack, 2.0f, at::ones(5));
|
||||
op->getOperation()(&stack);
|
||||
at::Tensor output;
|
||||
@ -63,7 +62,6 @@ TEST(CustomOperatorTest, ExplicitSchema) {
|
||||
ASSERT_EQ(op->schema().returns()[0].type()->kind(), TypeKind::TensorType);
|
||||
|
||||
Stack stack;
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
push(stack, 2.0f, at::ones(5));
|
||||
op->getOperation()(&stack);
|
||||
at::Tensor output;
|
||||
@ -108,14 +106,11 @@ TEST(CustomOperatorTest, ListParameters) {
|
||||
|
||||
Stack stack;
|
||||
push(stack, c10::List<int64_t>({1, 2}));
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
push(stack, c10::List<double>({1.0, 2.0}));
|
||||
push(
|
||||
stack,
|
||||
c10::List<c10::complex<double>>(
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
{c10::complex<double>(2.4, -5.5), c10::complex<double>(-1.3, 2)}));
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
push(stack, c10::List<at::Tensor>({at::ones(5)}));
|
||||
op->getOperation()(&stack);
|
||||
c10::List<double> output;
|
||||
@ -148,7 +143,6 @@ TEST(CustomOperatorTest, ListParameters2) {
|
||||
op->schema().returns()[0].type()->isSubtypeOf(ListType::ofTensors()));
|
||||
|
||||
Stack stack;
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
push(stack, c10::List<at::Tensor>({at::ones(5)}));
|
||||
op->getOperation()(&stack);
|
||||
c10::List<at::Tensor> output;
|
||||
@ -261,7 +255,6 @@ TEST(TestCustomOperator, OperatorGeneratorBasic) {
|
||||
ASSERT_EQ(op->schema().returns()[0].type()->kind(), TypeKind::TensorType);
|
||||
|
||||
Stack stack;
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers)
|
||||
push(stack, 2.0f, at::ones(5));
|
||||
op->getOperation()(&stack);
|
||||
at::Tensor output;
|
||||
|
||||
Reference in New Issue
Block a user