[codemod][fbcode/caffe2] Apply clang-format update fixes
Test Plan: Sandcastle and visual inspection.
Reviewed By: igorsugak
Differential Revision: D25849205
fbshipit-source-id: ef664c1ad4b3ee92d5c020a5511b4ef9837a09a0
diff --git a/test/cpp/jit/test_alias_analysis.cpp b/test/cpp/jit/test_alias_analysis.cpp
index e700ee5..58078c9 100644
--- a/test/cpp/jit/test_alias_analysis.cpp
+++ b/test/cpp/jit/test_alias_analysis.cpp
@@ -906,14 +906,15 @@
}
TEST(WildcardsTest, Basic) {
- RegisterOperators reg({Operator(
- "prim::returns_wildcard(Tensor a) -> Tensor(*)",
- [](Stack* stack) {},
- aliasAnalysisFromSchema()),
- Operator(
- "prim::writes(Tensor(z!) a) -> Tensor(a)",
- [](Stack* stack) {},
- aliasAnalysisFromSchema())});
+ RegisterOperators reg(
+ {Operator(
+ "prim::returns_wildcard(Tensor a) -> Tensor(*)",
+ [](Stack* stack) {},
+ aliasAnalysisFromSchema()),
+ Operator(
+ "prim::writes(Tensor(z!) a) -> Tensor(a)",
+ [](Stack* stack) {},
+ aliasAnalysisFromSchema())});
const auto returns_wildcard =
Symbol::fromQualString("prim::returns_wildcard");
const auto writes = Symbol::fromQualString("prim::writes");
diff --git a/test/cpp/jit/test_argument_spec.cpp b/test/cpp/jit/test_argument_spec.cpp
index bf40761..b653abe 100644
--- a/test/cpp/jit/test_argument_spec.cpp
+++ b/test/cpp/jit/test_argument_spec.cpp
@@ -50,21 +50,23 @@
auto const GF = at::CUDA(at::kFloat);
auto const GD = at::CUDA(at::kDouble);
- auto list = createStack({var(CF, {1}, true),
- var(CD, {1, 2}, false),
- var(GF, {}, true),
- var(GD, {4, 5, 6}, false),
- undef()});
+ auto list = createStack(
+ {var(CF, {1}, true),
+ var(CD, {1, 2}, false),
+ var(GF, {}, true),
+ var(GD, {4, 5, 6}, false),
+ undef()});
// make sure we have some non-standard strides
list[1].toTensor().transpose_(0, 1);
// same list but different backing values
- auto list2 = createStack({var(CF, {1}, true),
- var(CD, {1, 2}, false),
- var(GF, {}, true),
- var(GD, {4, 5, 6}, false),
- undef()});
+ auto list2 = createStack(
+ {var(CF, {1}, true),
+ var(CD, {1, 2}, false),
+ var(GF, {}, true),
+ var(GD, {4, 5, 6}, false),
+ undef()});
list2[1].toTensor().transpose_(0, 1);
CompleteArgumentSpec a(true, list);
@@ -142,21 +144,23 @@
ArgumentSpecCreator arg_spec_creator(*graph);
- auto list = createStack({var(CF, {1}, true),
- var(CD, {1, 2}, false),
- var(GF, {}, true),
- var(GD, {4, 5, 6}, false),
- undef()});
+ auto list = createStack(
+ {var(CF, {1}, true),
+ var(CD, {1, 2}, false),
+ var(GF, {}, true),
+ var(GD, {4, 5, 6}, false),
+ undef()});
// make sure we have some non-standard strides
list[1].toTensor().transpose_(0, 1);
// same list but different backing values
- auto list2 = createStack({var(CF, {1}, true),
- var(CD, {1, 2}, false),
- var(GF, {}, true),
- var(GD, {4, 5, 6}, false),
- undef()});
+ auto list2 = createStack(
+ {var(CF, {1}, true),
+ var(CD, {1, 2}, false),
+ var(GF, {}, true),
+ var(GD, {4, 5, 6}, false),
+ undef()});
list2[1].toTensor().transpose_(0, 1);
ArgumentSpec a = arg_spec_creator.create(true, list);
diff --git a/test/cpp/jit/test_gpu.cpp b/test/cpp/jit/test_gpu.cpp
index f8d25c4..5086cb5 100644
--- a/test/cpp/jit/test_gpu.cpp
+++ b/test/cpp/jit/test_gpu.cpp
@@ -2681,12 +2681,13 @@
using OpTuple = std::tuple<AtenFuncSig, BinaryOpType, std::string>;
// see [Note: explicit tuple type for uniform initialization list]
- std::vector<OpTuple> logic_ops{OpTuple{at::eq, BinaryOpType::Eq, "eq"},
- OpTuple{at::ge, BinaryOpType::GE, "ge"},
- OpTuple{at::gt, BinaryOpType::GT, "gt"},
- OpTuple{at::le, BinaryOpType::LE, "le"},
- OpTuple{at::lt, BinaryOpType::LT, "lt"},
- OpTuple{at::ne, BinaryOpType::NE, "ne"}};
+ std::vector<OpTuple> logic_ops{
+ OpTuple{at::eq, BinaryOpType::Eq, "eq"},
+ OpTuple{at::ge, BinaryOpType::GE, "ge"},
+ OpTuple{at::gt, BinaryOpType::GT, "gt"},
+ OpTuple{at::le, BinaryOpType::LE, "le"},
+ OpTuple{at::lt, BinaryOpType::LT, "lt"},
+ OpTuple{at::ne, BinaryOpType::NE, "ne"}};
std::for_each(logic_ops.begin(), logic_ops.end(), [](OpTuple& op) {
test_op(
@@ -4184,13 +4185,14 @@
sub_tv3->computeAt(sum_exp_rf_tv9, -1);
sub_tv3_copy->computeAt(output_tv7, -1);
- TensorView* tensors_to_parallelize[] = {max_val_tv1,
- bcast_max_tv2,
- sum_exp_tv5,
- bcast_sum_tv6,
- output_tv7,
- max_val_rf_tv8,
- sum_exp_rf_tv9};
+ TensorView* tensors_to_parallelize[] = {
+ max_val_tv1,
+ bcast_max_tv2,
+ sum_exp_tv5,
+ bcast_sum_tv6,
+ output_tv7,
+ max_val_rf_tv8,
+ sum_exp_rf_tv9};
for (auto tv : tensors_to_parallelize) {
tv->axis(-1)->parallelize(ParallelType::TIDx);
@@ -4318,13 +4320,14 @@
sub_tv3->computeAt(sum_exp_rf_tv9, -1);
sub_tv3_copy->computeAt(output_tv7, -1);
- TensorView* tensors_to_parallelize[] = {max_val_tv1,
- bcast_max_tv2,
- sum_exp_tv5,
- bcast_sum_tv6,
- output_tv7,
- max_val_rf_tv8,
- sum_exp_rf_tv9};
+ TensorView* tensors_to_parallelize[] = {
+ max_val_tv1,
+ bcast_max_tv2,
+ sum_exp_tv5,
+ bcast_sum_tv6,
+ output_tv7,
+ max_val_rf_tv8,
+ sum_exp_rf_tv9};
for (auto tv : tensors_to_parallelize) {
tv->axis(0)->parallelize(ParallelType::BIDx);
@@ -5931,15 +5934,16 @@
cache_x->setMemoryType(MemoryType::Shared);
exp->setMemoryType(MemoryType::Shared);
- std::vector<TensorView*> all_tensors({x,
- cache_x,
- max_val,
- bcast_max,
- x_max_sub,
- exp,
- sum_exp,
- bcast_sum,
- softmax});
+ std::vector<TensorView*> all_tensors(
+ {x,
+ cache_x,
+ max_val,
+ bcast_max,
+ x_max_sub,
+ exp,
+ sum_exp,
+ bcast_sum,
+ softmax});
auto tidx = new Int();
fusion.addInput(tidx);
@@ -6168,25 +6172,27 @@
std::vector<TensorView*> common_tensors(
{x_sum, x_sum_bcast, x_mean, var_sum, var_sum_bcast, var, var_eps, rvar});
- std::vector<TensorView*> static_tensors({sx,
- sx_cache,
- sx_sum,
- sx_mean_sub,
- sx_mean_sub_pow,
- sx_var_sum,
- sx_norm,
- sx_norm_gamma,
- sx_norm_gamma_beta});
+ std::vector<TensorView*> static_tensors(
+ {sx,
+ sx_cache,
+ sx_sum,
+ sx_mean_sub,
+ sx_mean_sub_pow,
+ sx_var_sum,
+ sx_norm,
+ sx_norm_gamma,
+ sx_norm_gamma_beta});
- std::vector<TensorView*> dynamic_tensors({dx,
- dx_cache,
- dx_sum,
- dx_mean_sub,
- dx_mean_sub_pow,
- dx_var_sum,
- dx_norm,
- dx_norm_gamma,
- dx_norm_gamma_beta});
+ std::vector<TensorView*> dynamic_tensors(
+ {dx,
+ dx_cache,
+ dx_sum,
+ dx_mean_sub,
+ dx_mean_sub_pow,
+ dx_var_sum,
+ dx_norm,
+ dx_norm_gamma,
+ dx_norm_gamma_beta});
std::vector<TensorView*> all_tensors;
all_tensors.insert(
@@ -6309,20 +6315,21 @@
cache_x->setMemoryType(MemoryType::Shared);
x_mean_sub->setMemoryType(MemoryType::Shared);
- std::vector<TensorView*> all_tensors({x_sum,
- x_mean,
- cache_x,
- x_sum_bcast,
- x_mean_sub,
- x_mean_sub_pow,
- var_sum,
- var_sum_bcast,
- var,
- var_eps,
- rvar,
- norm,
- norm_gamma,
- norm_gamma_beta});
+ std::vector<TensorView*> all_tensors(
+ {x_sum,
+ x_mean,
+ cache_x,
+ x_sum_bcast,
+ x_mean_sub,
+ x_mean_sub_pow,
+ var_sum,
+ var_sum_bcast,
+ var,
+ var_eps,
+ rvar,
+ norm,
+ norm_gamma,
+ norm_gamma_beta});
auto tidx = new Int();
fusion.addInput(tidx);
diff --git a/test/cpp/jit/test_misc.cpp b/test/cpp/jit/test_misc.cpp
index 5fb10d5..eaec2fe 100644
--- a/test/cpp/jit/test_misc.cpp
+++ b/test/cpp/jit/test_misc.cpp
@@ -1044,7 +1044,7 @@
ids.clear();
{ // START: global test
addGlobalCallback(RecordFunctionCallback(
- [](const RecordFunction &
+ [](const RecordFunction&
/* unused */) -> std::unique_ptr<at::ObserverContext> {
auto ctx = std::make_unique<TestContext>();
ctx->a = 123;
@@ -1070,7 +1070,7 @@
const int test_val = 234;
const std::string test_str = "test thread str";
addThreadLocalCallback(RecordFunctionCallback(
- [](const RecordFunction &
+ [](const RecordFunction&
/* unused */) -> std::unique_ptr<at::ObserverContext> {
auto ctx = std::make_unique<TestContext>();
ctx->a = 234;
diff --git a/test/cpp/tensorexpr/test_conv.cpp b/test/cpp/tensorexpr/test_conv.cpp
index c047c7b..f49cac7 100644
--- a/test/cpp/tensorexpr/test_conv.cpp
+++ b/test/cpp/tensorexpr/test_conv.cpp
@@ -75,9 +75,10 @@
at::Tensor result = at::empty_like(ref);
te::SimpleIREvaluator cg(s, {inputB, filterB, conv});
- cg.call({input.data_ptr<float>(),
- filter.data_ptr<float>(),
- result.data_ptr<float>()});
+ cg.call(
+ {input.data_ptr<float>(),
+ filter.data_ptr<float>(),
+ result.data_ptr<float>()});
ASSERT_TRUE(at::allclose(ref, result, 1e-3, 1e-3));
}
diff --git a/test/cpp/tensorexpr/test_llvm.cpp b/test/cpp/tensorexpr/test_llvm.cpp
index 5201416..7afb839 100644
--- a/test/cpp/tensorexpr/test_llvm.cpp
+++ b/test/cpp/tensorexpr/test_llvm.cpp
@@ -294,15 +294,15 @@
std::vector<void*> args({v.data()});
VarHandle x("x", kByte);
VarHandle y("y", kHalf);
- auto block =
- Block::make({Let::make(x, 3),
- Let::make(y, 6.f),
- a.store(
- {0},
- Cast::make(
- kDouble,
- ExprHandle(2.f) +
- (x * ExprHandle(3.f) + y * ExprHandle(4.f))))});
+ auto block = Block::make(
+ {Let::make(x, 3),
+ Let::make(y, 6.f),
+ a.store(
+ {0},
+ Cast::make(
+ kDouble,
+ ExprHandle(2.f) +
+ (x * ExprHandle(3.f) + y * ExprHandle(4.f))))});
LLVMCodeGen cg(block, {a});
ASSERT_EQ(cg.value<int>(args), 0);
diff --git a/test/cpp/tensorexpr/test_loopnest.cpp b/test/cpp/tensorexpr/test_loopnest.cpp
index 7294aa5..89ad7eb 100644
--- a/test/cpp/tensorexpr/test_loopnest.cpp
+++ b/test/cpp/tensorexpr/test_loopnest.cpp
@@ -2606,8 +2606,9 @@
x,
0,
kTotalSize,
- Block::make({Store::make(a_buf, {x}, x * 2),
- Store::make(b_buf, {x}, Load::make(a_buf, {x}, 1))}));
+ Block::make(
+ {Store::make(a_buf, {x}, x * 2),
+ Store::make(b_buf, {x}, Load::make(a_buf, {x}, 1))}));
Block::make({f});
Stmt* unrolled = nullptr;
LoopNest::unroll(f, &unrolled);
@@ -2658,9 +2659,10 @@
x,
0,
kTotalSize,
- Block::make({Let::make(e, 7),
- Store::make(a_buf, {x}, e),
- Store::make(b_buf, {x}, e + 1)}));
+ Block::make(
+ {Let::make(e, 7),
+ Store::make(a_buf, {x}, e),
+ Store::make(b_buf, {x}, e + 1)}));
Block::make({f});
Stmt* unrolled = nullptr;
LoopNest::unroll(f, &unrolled);
@@ -2700,9 +2702,9 @@
BufHandle a_buf("A", {ExprHandle(kTotalSize)}, kInt);
BufHandle b_buf("B", {ExprHandle(kTotalSize)}, kInt);
VarHandle x("x", kInt);
- auto for_body =
- Block::make({Store::make(a_buf, {x}, Load::make(kInt, b_buf, {x}, 1), 1),
- Store::make(b_buf, {x}, x * 2)});
+ auto for_body = Block::make(
+ {Store::make(a_buf, {x}, Load::make(kInt, b_buf, {x}, 1), 1),
+ Store::make(b_buf, {x}, x * 2)});
auto for_stmt = For::make(x, 50, 100, for_body);
Block::make({for_stmt});
@@ -2768,9 +2770,9 @@
BufHandle a_buf("A", {ExprHandle(kTotalSize)}, kInt);
BufHandle b_buf("B", {ExprHandle(kTotalSize)}, kInt);
VarHandle x("x", kInt);
- auto for_body =
- Block::make({Store::make(a_buf, {x}, Load::make(kInt, b_buf, {x}, 1), 1),
- Store::make(b_buf, {x}, x * 2)});
+ auto for_body = Block::make(
+ {Store::make(a_buf, {x}, Load::make(kInt, b_buf, {x}, 1), 1),
+ Store::make(b_buf, {x}, x * 2)});
auto for_stmt = For::make(x, 0, 100, for_body);
Block::make({for_stmt});
@@ -2803,9 +2805,9 @@
BufHandle b_buf("B", {ExprHandle(kTotalSize)}, kInt);
VarHandle x("x", kInt);
VarHandle y("y", kInt);
- auto for_body =
- Block::make({Store::make(a_buf, {x}, Load::make(kInt, b_buf, {x}, 1), 1),
- Store::make(b_buf, {x}, x * 2)});
+ auto for_body = Block::make(
+ {Store::make(a_buf, {x}, Load::make(kInt, b_buf, {x}, 1), 1),
+ Store::make(b_buf, {x}, x * 2)});
auto for_stmt = For::make(x, y, 100, for_body);
Block::make({for_stmt});
diff --git a/test/cpp/tensorexpr/test_memdependency.cpp b/test/cpp/tensorexpr/test_memdependency.cpp
index cfb3388..7105b9d 100644
--- a/test/cpp/tensorexpr/test_memdependency.cpp
+++ b/test/cpp/tensorexpr/test_memdependency.cpp
@@ -1990,13 +1990,13 @@
MemDependencyChecker analyzer({a}, {c});
Store* initStore = Store::make(c, {x}, Load::make(a, {x}, 1), 1);
ExprHandle conditionalLoad = Load::make(c, {0}, 1);
- Stmt* stmt =
- Block::make({For::make(x, 0, 10, initStore),
- Cond::make(
- CompareSelect::make(
- conditionalLoad, 5, CompareSelectOperation::kLT),
- Store::make(c, {0}, 5, 1),
- nullptr)});
+ Stmt* stmt = Block::make(
+ {For::make(x, 0, 10, initStore),
+ Cond::make(
+ CompareSelect::make(
+ conditionalLoad, 5, CompareSelectOperation::kLT),
+ Store::make(c, {0}, 5, 1),
+ nullptr)});
stmt->accept(&analyzer);
@@ -2177,11 +2177,12 @@
Store::make(b, {x}, Add::make(Load::make(b, {x}, 1), 1), 3);
For* secondLoop = For::make(x, 4, 7, secondStore);
- Stmt* stmt = Block::make({firstLoop,
- secondLoop,
- Store::make(b, {4}, 100, 1),
- Store::make(b, {5}, 101, 1),
- Store::make(b, {6}, 102, 1)});
+ Stmt* stmt = Block::make(
+ {firstLoop,
+ secondLoop,
+ Store::make(b, {4}, 100, 1),
+ Store::make(b, {5}, 101, 1),
+ Store::make(b, {6}, 102, 1)});
stmt->accept(&analyzer);
diff --git a/test/cpp/tensorexpr/test_registerizer.cpp b/test/cpp/tensorexpr/test_registerizer.cpp
index 0b8a5db..bfddb28 100644
--- a/test/cpp/tensorexpr/test_registerizer.cpp
+++ b/test/cpp/tensorexpr/test_registerizer.cpp
@@ -16,14 +16,14 @@
KernelScope kernel_scope;
BufHandle a("A", {1}, kInt);
VarHandle x("x", kInt);
- Stmt* stmt =
- Block::make({Store::make(a, {0}, 0, 1),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- a, {0}, Add::make(Load::make(a, {0}, 1), x), 1)}))});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {0}, 0, 1),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make({Store::make(
+ a, {0}, Add::make(Load::make(a, {0}, 1), x), 1)}))});
/*
* A[0] = 0;
@@ -61,14 +61,14 @@
KernelScope kernel_scope;
BufHandle a("A", {10}, kInt);
VarHandle x("x", kInt);
- Stmt* stmt =
- Block::make({Store::make(a, {0}, 0, 1),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- a, {x}, Add::make(Load::make(a, {x}, 1), x), 1)}))});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {0}, 0, 1),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make({Store::make(
+ a, {x}, Add::make(Load::make(a, {x}, 1), x), 1)}))});
/*
* A[0] = 0;
@@ -108,14 +108,14 @@
KernelScope kernel_scope;
BufHandle a("A", {1}, kInt);
VarHandle x("x", kInt);
- Stmt* stmt =
- Block::make({Store::make(a, {0}, 0, 1),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- a, {x}, Add::make(Load::make(a, {0}, 1), x), 1)}))});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {0}, 0, 1),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make({Store::make(
+ a, {x}, Add::make(Load::make(a, {0}, 1), x), 1)}))});
/*
* A[0] = 0;
@@ -518,14 +518,14 @@
VarHandle N("N", kInt);
BufHandle a("A", {N}, kInt);
VarHandle x("x", kInt);
- Stmt* stmt =
- Block::make({Store::make(a, {i}, 0, 1),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- a, {i}, Add::make(Load::make(a, {i}, 1), x), 1)}))});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {i}, 0, 1),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make({Store::make(
+ a, {i}, Add::make(Load::make(a, {i}, 1), x), 1)}))});
/*
* A[i] = 0;
@@ -720,14 +720,14 @@
BufHandle a("A", {1}, kInt);
BufHandle b("B", {10}, kInt);
VarHandle x("x", kInt);
- Stmt* stmt =
- Block::make({Store::make(a, {0}, 0, 1),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- b, {x}, Add::make(Load::make(a, {0}, 1), x), 1)}))});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {0}, 0, 1),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make({Store::make(
+ b, {x}, Add::make(Load::make(a, {0}, 1), x), 1)}))});
/*
* A[0] = 0;
@@ -941,8 +941,9 @@
x,
0,
10,
- Block::make({Store::make(b, {0}, Add::make(Load::make(a, {0}, 1), x), 1),
- Store::make(a, {0}, Load::make(b, {0}, 1), 1)}))});
+ Block::make(
+ {Store::make(b, {0}, Add::make(Load::make(a, {0}, 1), x), 1),
+ Store::make(a, {0}, Load::make(b, {0}, 1), 1)}))});
/*
* for (int x = 0; x < 10; x++) {
@@ -988,15 +989,15 @@
VarHandle x("x", kInt);
LoopOptions loopOpts;
loopOpts.set_gpu_block_index(0);
- Stmt* stmt =
- Block::make({Store::make(a, {0}, 0, 1),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- a, {0}, Add::make(Load::make(a, {0}, 1), x), 1)}),
- loopOpts)});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {0}, 0, 1),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make(
+ {Store::make(a, {0}, Add::make(Load::make(a, {0}, 1), x), 1)}),
+ loopOpts)});
/*
* A[0] = 0;
@@ -2428,13 +2429,14 @@
KernelScope kernel_scope;
BufHandle a("A", {1}, kInt);
VarHandle x("x", kInt);
- Stmt* stmt = Block::make({Store::make(a, {1}, Load::make(a, {0}, 1), 1),
- Store::make(a, {0}, Load::make(a, {1}, 1), 1),
- Store::make(a, {0}, Load::make(a, {1}, 1), 1),
- For::make(x, 1, 10, Store::make(a, {x}, x, 1)),
- Store::make(a, {1}, Load::make(a, {0}, 1), 1),
- Store::make(a, {0}, Load::make(a, {1}, 1), 1),
- Store::make(a, {0}, Load::make(a, {1}, 1), 1)});
+ Stmt* stmt = Block::make(
+ {Store::make(a, {1}, Load::make(a, {0}, 1), 1),
+ Store::make(a, {0}, Load::make(a, {1}, 1), 1),
+ Store::make(a, {0}, Load::make(a, {1}, 1), 1),
+ For::make(x, 1, 10, Store::make(a, {x}, x, 1)),
+ Store::make(a, {1}, Load::make(a, {0}, 1), 1),
+ Store::make(a, {0}, Load::make(a, {1}, 1), 1),
+ Store::make(a, {0}, Load::make(a, {1}, 1), 1)});
/*
* A[1] = A[0];
@@ -2502,9 +2504,10 @@
{Store::make(a, {0}, Add::make(Load::make(a, {0}, 1), 1), 1),
Block::make(
{Store::make(a, {0}, Add::make(Load::make(a, {0}, 1), 2), 1)}),
- Block::make({Store::make(a, {0}, Add::make(Load::make(a, {0}, 1), 3), 1),
- Block::make({Store::make(
- a, {0}, Add::make(Load::make(a, {0}, 1), 4), 1)})})});
+ Block::make(
+ {Store::make(a, {0}, Add::make(Load::make(a, {0}, 1), 3), 1),
+ Block::make({Store::make(
+ a, {0}, Add::make(Load::make(a, {0}, 1), 4), 1)})})});
/*
* A[0] = (A[0]) + 1;
@@ -3441,14 +3444,14 @@
BufHandle a("A", {10}, kInt);
VarHandle x("x", kInt);
VarHandle y("y", kInt);
- Stmt* stmt =
- Block::make({Let::make(y, 30),
- For::make(
- x,
- 0,
- 10,
- Block::make({Store::make(
- a, {y}, Add::make(x, Load::make(a, {y}, 1)), 1)}))});
+ Stmt* stmt = Block::make(
+ {Let::make(y, 30),
+ For::make(
+ x,
+ 0,
+ 10,
+ Block::make({Store::make(
+ a, {y}, Add::make(x, Load::make(a, {y}, 1)), 1)}))});
/*
* int y = 30;
diff --git a/test/cpp/tensorexpr/test_simplify.cpp b/test/cpp/tensorexpr/test_simplify.cpp
index 75df7ca..c34812e 100644
--- a/test/cpp/tensorexpr/test_simplify.cpp
+++ b/test/cpp/tensorexpr/test_simplify.cpp
@@ -3939,24 +3939,25 @@
// Can't fuse, CompareSelect results are different.
// Actually we totally could if we normalized CompareSelect results, but
// TODO for later.
- auto body = Block::make({Cond::make(
- CompareSelect::make(
- i,
- 10,
- new IntImm(1),
- new IntImm(0),
- CompareSelectOperation::kLT),
- Store::make(a, {0}, i, mask),
- nullptr),
- Cond::make(
- CompareSelect::make(
- j,
- 10,
- new IntImm(2),
- new IntImm(0),
- CompareSelectOperation::kLT),
- Store::make(a, {1}, i, mask),
- nullptr)});
+ auto body = Block::make(
+ {Cond::make(
+ CompareSelect::make(
+ i,
+ 10,
+ new IntImm(1),
+ new IntImm(0),
+ CompareSelectOperation::kLT),
+ Store::make(a, {0}, i, mask),
+ nullptr),
+ Cond::make(
+ CompareSelect::make(
+ j,
+ 10,
+ new IntImm(2),
+ new IntImm(0),
+ CompareSelectOperation::kLT),
+ Store::make(a, {1}, i, mask),
+ nullptr)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
@@ -4155,20 +4156,21 @@
{
// Can fuse if the conditions simplify to the same thing.
- auto body = Block::make({Cond::make(
- CompareSelect::make(
- i * 2,
- ExprHandle(87) % ExprHandle(11),
- CompareSelectOperation::kLT),
- Store::make(a, {0}, i, mask),
- nullptr),
- Cond::make(
- CompareSelect::make(
- i * 2,
- ExprHandle(300) / ExprHandle(30),
- CompareSelectOperation::kLT),
- Store::make(a, {1}, i, mask),
- nullptr)});
+ auto body = Block::make(
+ {Cond::make(
+ CompareSelect::make(
+ i * 2,
+ ExprHandle(87) % ExprHandle(11),
+ CompareSelectOperation::kLT),
+ Store::make(a, {0}, i, mask),
+ nullptr),
+ Cond::make(
+ CompareSelect::make(
+ i * 2,
+ ExprHandle(300) / ExprHandle(30),
+ CompareSelectOperation::kLT),
+ Store::make(a, {1}, i, mask),
+ nullptr)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
ASSERT_EQ(block->nstmts(), 1);
@@ -4181,9 +4183,9 @@
{
// Can fuse non-CompareSelects.
// if (i) { X } if (i) { Y } => if (i) { X; Y }
- auto body =
- Block::make({Cond::make(i, Store::make(a, {0}, i, mask), nullptr),
- Cond::make(i, Store::make(a, {1}, i, mask), nullptr)});
+ auto body = Block::make(
+ {Cond::make(i, Store::make(a, {0}, i, mask), nullptr),
+ Cond::make(i, Store::make(a, {1}, i, mask), nullptr)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
@@ -4196,9 +4198,9 @@
{
// Sanity check wont fuse different non-CompareSelects.
- auto body =
- Block::make({Cond::make(i, Store::make(a, {0}, i, mask), nullptr),
- Cond::make(j, Store::make(a, {1}, i, mask), nullptr)});
+ auto body = Block::make(
+ {Cond::make(i, Store::make(a, {0}, i, mask), nullptr),
+ Cond::make(j, Store::make(a, {1}, i, mask), nullptr)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
@@ -4210,9 +4212,9 @@
{
// Sanity check constant condition elimination still occurs when merging is
// possible.
- auto body =
- Block::make({Cond::make(1, Store::make(a, {0}, i, mask), nullptr),
- Cond::make(1, Store::make(a, {1}, i, mask), nullptr)});
+ auto body = Block::make(
+ {Cond::make(1, Store::make(a, {0}, i, mask), nullptr),
+ Cond::make(1, Store::make(a, {1}, i, mask), nullptr)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
ASSERT_EQ(block->nstmts(), 2);
@@ -4251,10 +4253,11 @@
{
// Merge two inner SyncThreads.
- auto body = Block::make({Store::make(a, {0}, 1, 1),
- new SyncThreads(),
- new SyncThreads(),
- Store::make(a, {1}, 0, 1)});
+ auto body = Block::make(
+ {Store::make(a, {0}, 1, 1),
+ new SyncThreads(),
+ new SyncThreads(),
+ Store::make(a, {1}, 0, 1)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
ASSERT_EQ(block->nstmts(), 3);
@@ -4278,13 +4281,14 @@
{
// Merge many inner SyncThreads.
- auto body = Block::make({Store::make(a, {0}, 1, 1),
- new SyncThreads(),
- new SyncThreads(),
- new SyncThreads(),
- new SyncThreads(),
- new SyncThreads(),
- Store::make(a, {1}, 0, 1)});
+ auto body = Block::make(
+ {Store::make(a, {0}, 1, 1),
+ new SyncThreads(),
+ new SyncThreads(),
+ new SyncThreads(),
+ new SyncThreads(),
+ new SyncThreads(),
+ Store::make(a, {1}, 0, 1)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
@@ -4297,13 +4301,14 @@
{
// Merge multiple outer SyncThreads.
- auto body = Block::make({new SyncThreads(),
- new SyncThreads(),
- Store::make(a, {1}, 0, 1),
- new SyncThreads(),
- new SyncThreads(),
- new SyncThreads(),
- new SyncThreads()});
+ auto body = Block::make(
+ {new SyncThreads(),
+ new SyncThreads(),
+ Store::make(a, {1}, 0, 1),
+ new SyncThreads(),
+ new SyncThreads(),
+ new SyncThreads(),
+ new SyncThreads()});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
@@ -4314,15 +4319,16 @@
{
// Merge multiple sections;
- auto body = Block::make({Store::make(a, {0}, 1, 1),
- new SyncThreads(),
- new SyncThreads(),
- Store::make(a, {1}, 0, 1),
- Store::make(a, {2}, 0, 1),
- new SyncThreads(),
- new SyncThreads(),
- new SyncThreads(),
- Store::make(a, {3}, 0, 1)});
+ auto body = Block::make(
+ {Store::make(a, {0}, 1, 1),
+ new SyncThreads(),
+ new SyncThreads(),
+ Store::make(a, {1}, 0, 1),
+ Store::make(a, {2}, 0, 1),
+ new SyncThreads(),
+ new SyncThreads(),
+ new SyncThreads(),
+ Store::make(a, {3}, 0, 1)});
Stmt* simplified = IRSimplifier::simplify(body);
IS_NODE_WITH_NAME(Block, simplified, block);
diff --git a/test/cpp/tensorexpr/test_train.cpp b/test/cpp/tensorexpr/test_train.cpp
index ceac7e7..5bfe68d 100644
--- a/test/cpp/tensorexpr/test_train.cpp
+++ b/test/cpp/tensorexpr/test_train.cpp
@@ -304,14 +304,15 @@
for (auto i = 0; i < 100; ++i) {
std::generate(X_.begin(), X_.end(), gen);
- cg.call({X_.data(),
- W_ref_.data(),
- W_.data(),
- one_.data(),
- K_.data(),
- LR_.data(),
- W_.data(),
- N});
+ cg.call(
+ {X_.data(),
+ W_ref_.data(),
+ W_.data(),
+ one_.data(),
+ K_.data(),
+ LR_.data(),
+ W_.data(),
+ N});
}
// Less than 1% difference after running regression
for (auto i = 0; i < W_.size(); ++i) {
diff --git a/test/cpp/tensorexpr/test_train_impl.cpp b/test/cpp/tensorexpr/test_train_impl.cpp
index b653f51..2beffa2 100644
--- a/test/cpp/tensorexpr/test_train_impl.cpp
+++ b/test/cpp/tensorexpr/test_train_impl.cpp
@@ -303,8 +303,9 @@
},
[](const std::vector<VTensor*>& inputs,
const std::vector<VTensor*>& ginputs) -> std::vector<VTensor*> {
- return {call("mul", {ginputs[0], inputs[1]})[0],
- call("mul", {ginputs[0], inputs[0]})[0]};
+ return {
+ call("mul", {ginputs[0], inputs[1]})[0],
+ call("mul", {ginputs[0], inputs[0]})[0]};
},
[](const std::vector<VTensor*>& inputs)
-> std::vector<std::vector<std::string>> {
@@ -329,8 +330,9 @@
const std::vector<VTensor*>& ginputs) -> std::vector<VTensor*> {
auto b_2 = call("mul", {inputs[1], inputs[1]})[0];
auto a_div_b_2 = call("div", {inputs[0], b_2})[0];
- return {call("div", {ginputs[0], inputs[1]})[0],
- call("mul", {ginputs[0], call("neg", {a_div_b_2})[0]})[0]};
+ return {
+ call("div", {ginputs[0], inputs[1]})[0],
+ call("mul", {ginputs[0], call("neg", {a_div_b_2})[0]})[0]};
},
[](const std::vector<VTensor*>& inputs)
-> std::vector<std::vector<std::string>> {
diff --git a/torch/csrc/jit/api/module.cpp b/torch/csrc/jit/api/module.cpp
index d74905b..3c53e54 100644
--- a/torch/csrc/jit/api/module.cpp
+++ b/torch/csrc/jit/api/module.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/api/module.h>
+
#include <ATen/record_function.h>
#include <c10/util/Exception.h>
#include <torch/csrc/autograd/generated/variable_factories.h>
diff --git a/torch/csrc/jit/backends/backend_detail.cpp b/torch/csrc/jit/backends/backend_detail.cpp
index 9ec2129..32a1817 100644
--- a/torch/csrc/jit/backends/backend_detail.cpp
+++ b/torch/csrc/jit/backends/backend_detail.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/backends/backend_detail.h>
+
#include <ATen/core/builtin_function.h>
namespace torch {
diff --git a/torch/csrc/jit/backends/backend_init.cpp b/torch/csrc/jit/backends/backend_init.cpp
index 596c19e..2f6ceeb 100644
--- a/torch/csrc/jit/backends/backend_init.cpp
+++ b/torch/csrc/jit/backends/backend_init.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/backends/backend_init.h>
+
#include <torch/csrc/jit/backends/backend_detail.h>
#include <torch/csrc/jit/backends/backend_resolver.h>
#include <torch/csrc/jit/frontend/code_template.h>
@@ -130,11 +131,12 @@
auto codegen_lambda = [=](const std::string& backend_name,
const Module& orig_module,
const py::dict& method_compile_spec) {
- const c10::QualifiedName qual_backend_name({"__torch__",
- "torch",
- "classes",
- detail::kBackendsNamespace,
- backend_name});
+ const c10::QualifiedName qual_backend_name(
+ {"__torch__",
+ "torch",
+ "classes",
+ detail::kBackendsNamespace,
+ backend_name});
// TODO: Validate method_compile_spec.
// Clone orig_module to make sure backend transformation is
diff --git a/torch/csrc/jit/codegen/cuda/arith.cpp b/torch/csrc/jit/codegen/cuda/arith.cpp
index f881dc2..a9abd22 100644
--- a/torch/csrc/jit/codegen/cuda/arith.cpp
+++ b/torch/csrc/jit/codegen/cuda/arith.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/arith.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
#include <torch/csrc/jit/codegen/cuda/type.h>
diff --git a/torch/csrc/jit/codegen/cuda/codegen.cpp b/torch/csrc/jit/codegen/cuda/codegen.cpp
index 459a6cc..c787404 100644
--- a/torch/csrc/jit/codegen/cuda/codegen.cpp
+++ b/torch/csrc/jit/codegen/cuda/codegen.cpp
@@ -293,9 +293,9 @@
code_ << *op << gen(node->in());
} else {
if (node->getUnaryOpType() == UnaryOpType::Cast) {
- const auto cast_str =
- cast_func_str({node->in()->getDataType().value(),
- node->out()->getDataType().value()});
+ const auto cast_str = cast_func_str(
+ {node->in()->getDataType().value(),
+ node->out()->getDataType().value()});
code_ << cast_str.value();
} else {
code_ << node->getUnaryOpType();
diff --git a/torch/csrc/jit/codegen/cuda/fusion.cpp b/torch/csrc/jit/codegen/cuda/fusion.cpp
index b6e6bd4..4a6fc58 100644
--- a/torch/csrc/jit/codegen/cuda/fusion.cpp
+++ b/torch/csrc/jit/codegen/cuda/fusion.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/fusion.h>
+
#include <torch/csrc/jit/codegen/cuda/codegen.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
diff --git a/torch/csrc/jit/codegen/cuda/index_compute.cpp b/torch/csrc/jit/codegen/cuda/index_compute.cpp
index 37eb8ca..eebf733 100644
--- a/torch/csrc/jit/codegen/cuda/index_compute.cpp
+++ b/torch/csrc/jit/codegen/cuda/index_compute.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/index_compute.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/codegen/cuda/arith.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
diff --git a/torch/csrc/jit/codegen/cuda/interface.cpp b/torch/csrc/jit/codegen/cuda/interface.cpp
index 09cddc4..b9a92ec 100644
--- a/torch/csrc/jit/codegen/cuda/interface.cpp
+++ b/torch/csrc/jit/codegen/cuda/interface.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/interface.h>
+
#include <ATen/core/dispatch/OperatorOptions.h>
#include <torch/csrc/jit/runtime/custom_operator.h>
#include <torch/csrc/jit/runtime/register_ops_utils.h>
diff --git a/torch/csrc/jit/codegen/cuda/ir_cloner.cpp b/torch/csrc/jit/codegen/cuda/ir_cloner.cpp
index 7fdb9d0..72ae3d5 100644
--- a/torch/csrc/jit/codegen/cuda/ir_cloner.cpp
+++ b/torch/csrc/jit/codegen/cuda/ir_cloner.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/ir_cloner.h>
+
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
diff --git a/torch/csrc/jit/codegen/cuda/ir_graphviz.cpp b/torch/csrc/jit/codegen/cuda/ir_graphviz.cpp
index 2aca8dd..ea3d31b 100644
--- a/torch/csrc/jit/codegen/cuda/ir_graphviz.cpp
+++ b/torch/csrc/jit/codegen/cuda/ir_graphviz.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/ir_graphviz.h>
+
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
#include <torch/csrc/jit/codegen/cuda/type.h>
@@ -372,8 +373,8 @@
const bool is_output = outputs_.find(tv) != outputs_.end();
const char* style = is_input ? "style=filled, fillcolor=palegreen"
- : is_output ? "style=filled, fillcolor=lightblue"
- : "style=filled, fillcolor=beige";
+ : is_output ? "style=filled, fillcolor=lightblue"
+ : "style=filled, fillcolor=beige";
graph_def_ << " " << getid(tv) << " [label=\"" << label.str()
<< "\", shape=Mrecord, color=brown, " << style << "];\n";
diff --git a/torch/csrc/jit/codegen/cuda/ir_iostream.cpp b/torch/csrc/jit/codegen/cuda/ir_iostream.cpp
index 145a1b2..8108a3c 100644
--- a/torch/csrc/jit/codegen/cuda/ir_iostream.cpp
+++ b/torch/csrc/jit/codegen/cuda/ir_iostream.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/ir_iostream.h>
+
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
diff --git a/torch/csrc/jit/codegen/cuda/iter_visitor.cpp b/torch/csrc/jit/codegen/cuda/iter_visitor.cpp
index 4cbdba8..d1efc6d 100644
--- a/torch/csrc/jit/codegen/cuda/iter_visitor.cpp
+++ b/torch/csrc/jit/codegen/cuda/iter_visitor.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/iter_visitor.h>
+
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
#include <torch/csrc/jit/codegen/cuda/ir_iostream.h>
diff --git a/torch/csrc/jit/codegen/cuda/iter_visitor.h b/torch/csrc/jit/codegen/cuda/iter_visitor.h
index 7d8ba55..d70c4f9 100644
--- a/torch/csrc/jit/codegen/cuda/iter_visitor.h
+++ b/torch/csrc/jit/codegen/cuda/iter_visitor.h
@@ -68,8 +68,8 @@
virtual std::vector<Statement*> next(Expr* expr) {
FusionGuard::getCurFusion()->assertInFusion(expr, "Cannot traverse expr, ");
- std::vector<Statement*> next_stmts{expr->inputs().begin(),
- expr->inputs().end()};
+ std::vector<Statement*> next_stmts{
+ expr->inputs().begin(), expr->inputs().end()};
return next_stmts;
}
diff --git a/torch/csrc/jit/codegen/cuda/kernel.cpp b/torch/csrc/jit/codegen/cuda/kernel.cpp
index ef54151..1ad8d06 100644
--- a/torch/csrc/jit/codegen/cuda/kernel.cpp
+++ b/torch/csrc/jit/codegen/cuda/kernel.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/kernel.h>
+
#include <torch/csrc/jit/codegen/cuda/dispatch.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/kernel_ir_printer.h>
diff --git a/torch/csrc/jit/codegen/cuda/kernel_cache.cpp b/torch/csrc/jit/codegen/cuda/kernel_cache.cpp
index 5bddc51..6b5585d 100644
--- a/torch/csrc/jit/codegen/cuda/kernel_cache.cpp
+++ b/torch/csrc/jit/codegen/cuda/kernel_cache.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/kernel_cache.h>
+
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/ir_utils.h>
#include <torch/csrc/jit/codegen/cuda/parser.h>
diff --git a/torch/csrc/jit/codegen/cuda/kernel_ir_printer.cpp b/torch/csrc/jit/codegen/cuda/kernel_ir_printer.cpp
index 4d7913e..4a20543 100644
--- a/torch/csrc/jit/codegen/cuda/kernel_ir_printer.cpp
+++ b/torch/csrc/jit/codegen/cuda/kernel_ir_printer.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/kernel_ir_printer.h>
+
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/type.h>
@@ -163,8 +164,9 @@
os_ << *op << gen(node->in());
} else {
if (node->getUnaryOpType() == UnaryOpType::Cast) {
- const auto cast_str = cast_func_str({node->in()->getDataType().value(),
- node->out()->getDataType().value()});
+ const auto cast_str = cast_func_str(
+ {node->in()->getDataType().value(),
+ node->out()->getDataType().value()});
os_ << cast_str.value();
} else {
os_ << node->getUnaryOpType();
diff --git a/torch/csrc/jit/codegen/cuda/lower2device.cpp b/torch/csrc/jit/codegen/cuda/lower2device.cpp
index 7f0dd63..fe36afb 100644
--- a/torch/csrc/jit/codegen/cuda/lower2device.cpp
+++ b/torch/csrc/jit/codegen/cuda/lower2device.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/lower2device.h>
+
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/ir_iostream.h>
diff --git a/torch/csrc/jit/codegen/cuda/lower_alias_memory.cpp b/torch/csrc/jit/codegen/cuda/lower_alias_memory.cpp
index f8c189c..12c5254 100644
--- a/torch/csrc/jit/codegen/cuda/lower_alias_memory.cpp
+++ b/torch/csrc/jit/codegen/cuda/lower_alias_memory.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/lower_alias_memory.h>
+
#include <torch/csrc/jit/codegen/cuda/expr_evaluator.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/ir_utils.h>
diff --git a/torch/csrc/jit/codegen/cuda/lower_insert_syncs.cpp b/torch/csrc/jit/codegen/cuda/lower_insert_syncs.cpp
index 4431025..4326b83 100644
--- a/torch/csrc/jit/codegen/cuda/lower_insert_syncs.cpp
+++ b/torch/csrc/jit/codegen/cuda/lower_insert_syncs.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/lower_insert_syncs.h>
+
#include <torch/csrc/jit/codegen/cuda/expr_evaluator.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/ir_iostream.h>
diff --git a/torch/csrc/jit/codegen/cuda/lower_loops.cpp b/torch/csrc/jit/codegen/cuda/lower_loops.cpp
index e98761a..a291916 100644
--- a/torch/csrc/jit/codegen/cuda/lower_loops.cpp
+++ b/torch/csrc/jit/codegen/cuda/lower_loops.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/lower_loops.h>
+
#include <torch/csrc/jit/codegen/cuda/arith.h>
#include <torch/csrc/jit/codegen/cuda/ir_iostream.h>
#include <torch/csrc/jit/codegen/cuda/ir_utils.h>
diff --git a/torch/csrc/jit/codegen/cuda/lower_utils.cpp b/torch/csrc/jit/codegen/cuda/lower_utils.cpp
index 4d59b35..cfb2fce 100644
--- a/torch/csrc/jit/codegen/cuda/lower_utils.cpp
+++ b/torch/csrc/jit/codegen/cuda/lower_utils.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/lower_utils.h>
+
#include <torch/csrc/jit/codegen/cuda/arith.h>
#include <torch/csrc/jit/codegen/cuda/ir_iostream.h>
#include <torch/csrc/jit/codegen/cuda/ir_utils.h>
@@ -488,12 +489,13 @@
}
const std::unordered_map<ParallelType, int, TypeHash>
- ParallelTypeBitmap::pt_to_offset_{{ParallelType::BIDx, 0},
- {ParallelType::BIDy, 1},
- {ParallelType::BIDz, 2},
- {ParallelType::TIDx, 3},
- {ParallelType::TIDy, 4},
- {ParallelType::TIDz, 5}};
+ ParallelTypeBitmap::pt_to_offset_{
+ {ParallelType::BIDx, 0},
+ {ParallelType::BIDy, 1},
+ {ParallelType::BIDz, 2},
+ {ParallelType::TIDx, 3},
+ {ParallelType::TIDy, 4},
+ {ParallelType::TIDz, 5}};
const std::unordered_map<int, ParallelType> ParallelTypeBitmap::offset_to_pt_ =
{{0, ParallelType::BIDx},
diff --git a/torch/csrc/jit/codegen/cuda/lower_validation.cpp b/torch/csrc/jit/codegen/cuda/lower_validation.cpp
index 1ec32be..1967a66 100644
--- a/torch/csrc/jit/codegen/cuda/lower_validation.cpp
+++ b/torch/csrc/jit/codegen/cuda/lower_validation.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/lower_validation.h>
+
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/iter_visitor.h>
#include <torch/csrc/jit/codegen/cuda/lower_utils.h>
diff --git a/torch/csrc/jit/codegen/cuda/mutator.cpp b/torch/csrc/jit/codegen/cuda/mutator.cpp
index affaddc..7e7dcf7 100644
--- a/torch/csrc/jit/codegen/cuda/mutator.cpp
+++ b/torch/csrc/jit/codegen/cuda/mutator.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/mutator.h>
+
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/ir_all_nodes.h>
diff --git a/torch/csrc/jit/codegen/cuda/partition.cpp b/torch/csrc/jit/codegen/cuda/partition.cpp
index a686567..88aaa3e 100644
--- a/torch/csrc/jit/codegen/cuda/partition.cpp
+++ b/torch/csrc/jit/codegen/cuda/partition.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/partition.h>
+
#include <ATen/core/jit_type.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/codegen/cuda/parser.h>
diff --git a/torch/csrc/jit/codegen/cuda/runtime/grid_reduction.cu b/torch/csrc/jit/codegen/cuda/runtime/grid_reduction.cu
index 15e2041..8900ab8 100644
--- a/torch/csrc/jit/codegen/cuda/runtime/grid_reduction.cu
+++ b/torch/csrc/jit/codegen/cuda/runtime/grid_reduction.cu
@@ -63,9 +63,10 @@
// Returns dim3 of each reduction segment.
template <bool X_BLOCK, bool Y_BLOCK, bool Z_BLOCK, typename _dim3>
__device__ dim3 dimension_of_reduction_segment(const _dim3& grid_dim) {
- return dim3{X_BLOCK ? grid_dim.x : 1,
- Y_BLOCK ? grid_dim.y : 1,
- Z_BLOCK ? grid_dim.z : 1};
+ return dim3{
+ X_BLOCK ? grid_dim.x : 1,
+ Y_BLOCK ? grid_dim.y : 1,
+ Z_BLOCK ? grid_dim.z : 1};
}
// Returns the number of blocks in each reduction segment.
@@ -123,9 +124,10 @@
// Returns dim3 of each reduction block.
template <bool X_THREAD, bool Y_THREAD, bool Z_THREAD, typename _dim3>
__device__ dim3 dimension_of_reduction_block(const _dim3& block_dim) {
- return dim3{X_THREAD ? block_dim.x : 1,
- Y_THREAD ? block_dim.y : 1,
- Z_THREAD ? block_dim.z : 1};
+ return dim3{
+ X_THREAD ? block_dim.x : 1,
+ Y_THREAD ? block_dim.y : 1,
+ Z_THREAD ? block_dim.z : 1};
}
// Returns the number of threads of each reduction block.
diff --git a/torch/csrc/jit/codegen/cuda/shape_inference.cpp b/torch/csrc/jit/codegen/cuda/shape_inference.cpp
index 7b49cce..5430d0e 100644
--- a/torch/csrc/jit/codegen/cuda/shape_inference.cpp
+++ b/torch/csrc/jit/codegen/cuda/shape_inference.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/shape_inference.h>
+
#include <c10/core/ScalarType.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
#include <torch/csrc/jit/ir/constants.h>
diff --git a/torch/csrc/jit/codegen/cuda/transform_iter.cpp b/torch/csrc/jit/codegen/cuda/transform_iter.cpp
index 479177d..c7c356b 100644
--- a/torch/csrc/jit/codegen/cuda/transform_iter.cpp
+++ b/torch/csrc/jit/codegen/cuda/transform_iter.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/transform_iter.h>
+
#include <torch/csrc/jit/codegen/cuda/ir_utils.h>
namespace torch {
diff --git a/torch/csrc/jit/codegen/cuda/transform_replay.cpp b/torch/csrc/jit/codegen/cuda/transform_replay.cpp
index 4a57a0f..120904a 100644
--- a/torch/csrc/jit/codegen/cuda/transform_replay.cpp
+++ b/torch/csrc/jit/codegen/cuda/transform_replay.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/cuda/transform_replay.h>
+
#include <torch/csrc/jit/codegen/cuda/arith.h>
#include <torch/csrc/jit/codegen/cuda/fusion.h>
#include <torch/csrc/jit/codegen/cuda/instrumentation.h>
diff --git a/torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp b/torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp
index 4f4aa0d..6d249ee 100644
--- a/torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp
+++ b/torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/fuser/cpu/fused_kernel.h>
+
#include <c10/util/Exception.h>
#include <c10/util/Optional.h>
#include <torch/csrc/jit/codegen/fuser/compiler.h>
diff --git a/torch/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp b/torch/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp
index 9971cb7..03ae998 100644
--- a/torch/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp
+++ b/torch/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/codegen/fuser/cuda/fused_kernel.h>
+
#include <torch/csrc/jit/codegen/fuser/compiler.h>
#include <ATen/ATen.h>
diff --git a/torch/csrc/jit/frontend/builtin_functions.cpp b/torch/csrc/jit/frontend/builtin_functions.cpp
index 22bd5b6..a8d0795 100644
--- a/torch/csrc/jit/frontend/builtin_functions.cpp
+++ b/torch/csrc/jit/frontend/builtin_functions.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/builtin_functions.h>
+
#include <torch/csrc/api/include/torch/jit.h>
#include <torch/csrc/jit/frontend/code_template.h>
#include <torch/csrc/jit/frontend/resolver.h>
diff --git a/torch/csrc/jit/frontend/concrete_module_type.cpp b/torch/csrc/jit/frontend/concrete_module_type.cpp
index be3c173..b9ef3ec 100644
--- a/torch/csrc/jit/frontend/concrete_module_type.cpp
+++ b/torch/csrc/jit/frontend/concrete_module_type.cpp
@@ -256,8 +256,8 @@
TORCH_INTERNAL_ASSERT(type);
functionAttributes_.emplace(
std::move(name),
- ConcreteModuleTypeBuilder::FunctionAttribute{type->expect<FunctionType>(),
- std::move(pyFunction)});
+ ConcreteModuleTypeBuilder::FunctionAttribute{
+ type->expect<FunctionType>(), std::move(pyFunction)});
}
void ConcreteModuleTypeBuilder::addBuiltinFunction(
diff --git a/torch/csrc/jit/frontend/error_report.cpp b/torch/csrc/jit/frontend/error_report.cpp
index d148214..0c20014 100644
--- a/torch/csrc/jit/frontend/error_report.cpp
+++ b/torch/csrc/jit/frontend/error_report.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/error_report.h>
+
#include <c10/util/Optional.h>
#include <torch/csrc/jit/frontend/tree.h>
#include <torch/csrc/utils/memory.h>
diff --git a/torch/csrc/jit/frontend/exit_transforms.cpp b/torch/csrc/jit/frontend/exit_transforms.cpp
index 60e3bb4..bb94f4d 100644
--- a/torch/csrc/jit/frontend/exit_transforms.cpp
+++ b/torch/csrc/jit/frontend/exit_transforms.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/exit_transforms.h>
+
#include <ATen/core/jit_type.h>
#include <torch/csrc/jit/frontend/error_report.h>
#include <torch/csrc/jit/ir/ir.h>
diff --git a/torch/csrc/jit/frontend/function_schema_parser.cpp b/torch/csrc/jit/frontend/function_schema_parser.cpp
index e7d9da1..2daeabc 100644
--- a/torch/csrc/jit/frontend/function_schema_parser.cpp
+++ b/torch/csrc/jit/frontend/function_schema_parser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/function_schema_parser.h>
+
#include <ATen/core/Reduction.h>
#include <c10/util/string_utils.h>
#include <torch/csrc/jit/frontend/lexer.h>
diff --git a/torch/csrc/jit/frontend/parser.cpp b/torch/csrc/jit/frontend/parser.cpp
index 2e1b2c9..87ae08a 100644
--- a/torch/csrc/jit/frontend/parser.cpp
+++ b/torch/csrc/jit/frontend/parser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/parser.h>
+
#include <c10/util/Optional.h>
#include <torch/csrc/jit/frontend/lexer.h>
#include <torch/csrc/jit/frontend/parse_string_literal.h>
@@ -267,8 +268,9 @@
auto kind = L.cur().kind;
auto pos = L.cur().range;
L.next();
- auto unary_kind =
- kind == '*' ? TK_STARRED : kind == '-' ? TK_UNARY_MINUS : kind;
+ auto unary_kind = kind == '*' ? TK_STARRED
+ : kind == '-' ? TK_UNARY_MINUS
+ : kind;
auto subexp = parseExp(unary_prec);
// fold '-' into constant numbers, so that attributes can accept
// things like -1
diff --git a/torch/csrc/jit/frontend/schema_matching.cpp b/torch/csrc/jit/frontend/schema_matching.cpp
index f431dd3..86c1c2f 100644
--- a/torch/csrc/jit/frontend/schema_matching.cpp
+++ b/torch/csrc/jit/frontend/schema_matching.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/schema_matching.h>
+
#include <ATen/core/jit_type.h>
#include <torch/csrc/jit/frontend/builtin_functions.h>
#include <torch/csrc/jit/frontend/error_report.h>
@@ -454,9 +455,10 @@
return_field_names =
fmap(returns, [&](const Argument& r) { return r.name(); });
}
- return MatchedSchema{std::move(positional_inputs),
- std::move(return_types),
- std::move(return_field_names)};
+ return MatchedSchema{
+ std::move(positional_inputs),
+ std::move(return_types),
+ std::move(return_field_names)};
}
MatchedSchema matchSchema(
diff --git a/torch/csrc/jit/frontend/schema_type_parser.cpp b/torch/csrc/jit/frontend/schema_type_parser.cpp
index 05b7bf2..1785a24 100644
--- a/torch/csrc/jit/frontend/schema_type_parser.cpp
+++ b/torch/csrc/jit/frontend/schema_type_parser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/schema_type_parser.h>
+
#include <ATen/core/alias_info.h>
#include <ATen/core/interned_strings.h>
#include <ATen/core/jit_type.h>
diff --git a/torch/csrc/jit/frontend/script_type_parser.cpp b/torch/csrc/jit/frontend/script_type_parser.cpp
index f4c1fa2..64837e6 100644
--- a/torch/csrc/jit/frontend/script_type_parser.cpp
+++ b/torch/csrc/jit/frontend/script_type_parser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/script_type_parser.h>
+
#include <torch/csrc/jit/frontend/parser.h>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/custom_class.h>
diff --git a/torch/csrc/jit/frontend/sugared_value.h b/torch/csrc/jit/frontend/sugared_value.h
index 6f8b760..85bf1d2 100644
--- a/torch/csrc/jit/frontend/sugared_value.h
+++ b/torch/csrc/jit/frontend/sugared_value.h
@@ -539,8 +539,8 @@
size_t n_binders) override {
TORCH_INTERNAL_ASSERT(args.size() == 0 && kwargs.size() == 0);
Value* dtype_const = m.graph()->insertConstant(dtype_, loc);
- std::vector<NamedValue> kwargs_{self_,
- NamedValue(loc, "dtype", dtype_const)};
+ std::vector<NamedValue> kwargs_{
+ self_, NamedValue(loc, "dtype", dtype_const)};
Value* casted_val = m.graph()->insert(
/*opname=*/Symbol::fromQualString("aten::to"),
/*args=*/args,
diff --git a/torch/csrc/jit/frontend/versioned_symbols.cpp b/torch/csrc/jit/frontend/versioned_symbols.cpp
index 8e39e6f..d7ee0d3 100644
--- a/torch/csrc/jit/frontend/versioned_symbols.cpp
+++ b/torch/csrc/jit/frontend/versioned_symbols.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/frontend/versioned_symbols.h>
+
#include <torch/csrc/api/include/torch/jit.h>
#include <unordered_map>
diff --git a/torch/csrc/jit/ir/attributes.h b/torch/csrc/jit/ir/attributes.h
index ef8daee..16789a1 100644
--- a/torch/csrc/jit/ir/attributes.h
+++ b/torch/csrc/jit/ir/attributes.h
@@ -21,19 +21,20 @@
enum class AttributeKind { f, fs, i, is, s, ss, t, ts, g, gs, ty, tys, ival };
static inline const char* toString(AttributeKind kind) {
- static const char* names[] = {"f",
- "fs",
- "i",
- "is",
- "s",
- "ss",
- "t",
- "ts",
- "g",
- "gs",
- "ty",
- "tys",
- "ival"};
+ static const char* names[] = {
+ "f",
+ "fs",
+ "i",
+ "is",
+ "s",
+ "ss",
+ "t",
+ "ts",
+ "g",
+ "gs",
+ "ty",
+ "tys",
+ "ival"};
AT_ASSERT(size_t(kind) < sizeof(names) / sizeof(*names));
return names[int(kind)];
}
diff --git a/torch/csrc/jit/ir/constants.cpp b/torch/csrc/jit/ir/constants.cpp
index df948a6..512533e 100644
--- a/torch/csrc/jit/ir/constants.cpp
+++ b/torch/csrc/jit/ir/constants.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/ir/constants.h>
+
#include <ATen/core/functional.h>
#include <torch/csrc/autograd/variable.h>
#include <torch/csrc/jit/ir/ir.h>
diff --git a/torch/csrc/jit/ir/irparser.cpp b/torch/csrc/jit/ir/irparser.cpp
index 8c278cb..ce4307c 100644
--- a/torch/csrc/jit/ir/irparser.cpp
+++ b/torch/csrc/jit/ir/irparser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/ir/irparser.h>
+
#include <torch/csrc/jit/frontend/lexer.h>
#include <torch/csrc/jit/frontend/parse_string_literal.h>
#include <torch/csrc/jit/frontend/schema_type_parser.h>
diff --git a/torch/csrc/jit/ir/scope.cpp b/torch/csrc/jit/ir/scope.cpp
index eba291b..ba1bced 100644
--- a/torch/csrc/jit/ir/scope.cpp
+++ b/torch/csrc/jit/ir/scope.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/ir/scope.h>
+
#include <ATen/core/function.h>
namespace torch {
diff --git a/torch/csrc/jit/ir/type_hashing.cpp b/torch/csrc/jit/ir/type_hashing.cpp
index a03f650..c447ceb 100644
--- a/torch/csrc/jit/ir/type_hashing.cpp
+++ b/torch/csrc/jit/ir/type_hashing.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/ir/type_hashing.h>
+
#include <ATen/core/functional.h>
#include <ATen/core/jit_type.h>
#include <ATen/core/qualified_name.h>
diff --git a/torch/csrc/jit/mobile/function.cpp b/torch/csrc/jit/mobile/function.cpp
index 8748bb6..47d492c 100644
--- a/torch/csrc/jit/mobile/function.cpp
+++ b/torch/csrc/jit/mobile/function.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/mobile/function.h>
+
#include <caffe2/serialize/inline_container.h>
#include <torch/csrc/jit/mobile/interpreter.h>
#include <torch/csrc/jit/runtime/instruction.h>
diff --git a/torch/csrc/jit/mobile/import.cpp b/torch/csrc/jit/mobile/import.cpp
index a32eff6..3e7e005 100644
--- a/torch/csrc/jit/mobile/import.cpp
+++ b/torch/csrc/jit/mobile/import.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/mobile/import.h>
+
#include <ATen/core/ivalue.h>
#include <caffe2/serialize/inline_container.h>
#include <torch/csrc/jit/api/compilation_unit.h>
diff --git a/torch/csrc/jit/mobile/interpreter.cpp b/torch/csrc/jit/mobile/interpreter.cpp
index 681eddf..008c42b 100644
--- a/torch/csrc/jit/mobile/interpreter.cpp
+++ b/torch/csrc/jit/mobile/interpreter.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/mobile/interpreter.h>
+
#include <ATen/core/function.h>
#include <ATen/core/jit_type.h>
#include <ATen/core/operator_name.h>
diff --git a/torch/csrc/jit/mobile/module.cpp b/torch/csrc/jit/mobile/module.cpp
index 6e78d4f..1155a5f 100644
--- a/torch/csrc/jit/mobile/module.cpp
+++ b/torch/csrc/jit/mobile/module.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/mobile/module.h>
+
#include <torch/csrc/jit/mobile/interpreter.h>
#include <torch/csrc/jit/mobile/observer.h>
#include <torch/csrc/jit/runtime/jit_exception.h>
diff --git a/torch/csrc/jit/mobile/type_parser.cpp b/torch/csrc/jit/mobile/type_parser.cpp
index 546aabd..42814e5 100644
--- a/torch/csrc/jit/mobile/type_parser.cpp
+++ b/torch/csrc/jit/mobile/type_parser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/mobile/type_parser.h>
+
#include <ATen/core/jit_type.h>
#include <torch/csrc/jit/frontend/parser_constants.h>
#include <torch/custom_class.h>
diff --git a/torch/csrc/jit/passes/bailout_graph.cpp b/torch/csrc/jit/passes/bailout_graph.cpp
index cfe1850..7e721e1 100644
--- a/torch/csrc/jit/passes/bailout_graph.cpp
+++ b/torch/csrc/jit/passes/bailout_graph.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/bailout_graph.h>
+
#include <ATen/core/function.h>
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/ir/ir_views.h>
diff --git a/torch/csrc/jit/passes/canonicalize.cpp b/torch/csrc/jit/passes/canonicalize.cpp
index 5180ce6..4a41e8f 100644
--- a/torch/csrc/jit/passes/canonicalize.cpp
+++ b/torch/csrc/jit/passes/canonicalize.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/canonicalize.h>
+
#include <torch/csrc/jit/ir/ir_views.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/clear_profiling.cpp b/torch/csrc/jit/passes/clear_profiling.cpp
index 809d177..9acb9fb 100644
--- a/torch/csrc/jit/passes/clear_profiling.cpp
+++ b/torch/csrc/jit/passes/clear_profiling.cpp
@@ -1,5 +1,6 @@
#include <torch/csrc/jit/passes/clear_profiling.h>
+
#include <torch/csrc/jit/jit_log.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/clear_undefinedness.cpp b/torch/csrc/jit/passes/clear_undefinedness.cpp
index 591c824..b235cbb 100644
--- a/torch/csrc/jit/passes/clear_undefinedness.cpp
+++ b/torch/csrc/jit/passes/clear_undefinedness.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/clear_undefinedness.h>
+
#include <torch/csrc/jit/jit_log.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/constant_pooling.cpp b/torch/csrc/jit/passes/constant_pooling.cpp
index 2ee9dd1..06a5d61 100644
--- a/torch/csrc/jit/passes/constant_pooling.cpp
+++ b/torch/csrc/jit/passes/constant_pooling.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/constant_pooling.h>
+
#include <ATen/core/interned_strings.h>
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/ir/ir.h>
diff --git a/torch/csrc/jit/passes/constant_propagation.cpp b/torch/csrc/jit/passes/constant_propagation.cpp
index 75be7e86..3db17e5 100644
--- a/torch/csrc/jit/passes/constant_propagation.cpp
+++ b/torch/csrc/jit/passes/constant_propagation.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/constant_propagation.h>
+
#include <ATen/core/functional.h>
#include <ATen/core/ivalue.h>
#include <c10/util/Exception.h>
diff --git a/torch/csrc/jit/passes/create_functional_graphs.cpp b/torch/csrc/jit/passes/create_functional_graphs.cpp
index a5c2c6f..d5d85f6 100644
--- a/torch/csrc/jit/passes/create_functional_graphs.cpp
+++ b/torch/csrc/jit/passes/create_functional_graphs.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/create_functional_graphs.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/passes/constant_pooling.h>
diff --git a/torch/csrc/jit/passes/decompose_ops.cpp b/torch/csrc/jit/passes/decompose_ops.cpp
index 2d0f70a..ad8dcf3 100644
--- a/torch/csrc/jit/passes/decompose_ops.cpp
+++ b/torch/csrc/jit/passes/decompose_ops.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/decompose_ops.h>
+
#include <torch/csrc/jit/frontend/ir_emitter.h>
#include <torch/csrc/jit/passes/constant_propagation.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
@@ -125,12 +126,13 @@
Graph* graph = it->owningGraph();
Value* input = it->namedInput(attr::input);
Value* input_dim = graph->insert(aten::dim, {input});
- std::vector<Value*> inputs{input,
- it->namedInput(attr::running_mean),
- it->namedInput(attr::running_var),
- it->namedInput(attr::training),
- it->namedInput(attr::momentum),
- it->namedInput(attr::eps)};
+ std::vector<Value*> inputs{
+ input,
+ it->namedInput(attr::running_mean),
+ it->namedInput(attr::running_var),
+ it->namedInput(attr::training),
+ it->namedInput(attr::momentum),
+ it->namedInput(attr::eps)};
// inline the compiled decomposed batchnorm
std::shared_ptr<Graph> d_graph =
@@ -161,10 +163,11 @@
decomposed = true;
WithInsertPoint insert_guard{*it};
Graph* graph = it->owningGraph();
- std::vector<Value*> inputs{it->namedInput(attr::input),
- it->namedInput(attr::normalized_shape),
- it->namedInput(attr::eps),
- it->namedInput(attr::cudnn_enable)};
+ std::vector<Value*> inputs{
+ it->namedInput(attr::input),
+ it->namedInput(attr::normalized_shape),
+ it->namedInput(attr::eps),
+ it->namedInput(attr::cudnn_enable)};
// inline the compiled decomposed layernorm
std::shared_ptr<Graph> d_graph =
diff --git a/torch/csrc/jit/passes/erase_number_types.cpp b/torch/csrc/jit/passes/erase_number_types.cpp
index 7e6a453..738bb48 100644
--- a/torch/csrc/jit/passes/erase_number_types.cpp
+++ b/torch/csrc/jit/passes/erase_number_types.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/erase_number_types.h>
+
#include <torch/csrc/jit/ir/constants.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
diff --git a/torch/csrc/jit/passes/fold_conv_bn.cpp b/torch/csrc/jit/passes/fold_conv_bn.cpp
index 7d34463..8ebde97 100644
--- a/torch/csrc/jit/passes/fold_conv_bn.cpp
+++ b/torch/csrc/jit/passes/fold_conv_bn.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/fold_conv_bn.h>
+
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/graph_rewrite_helper.h>
diff --git a/torch/csrc/jit/passes/freeze_module.cpp b/torch/csrc/jit/passes/freeze_module.cpp
index f66f54e..38684d2 100644
--- a/torch/csrc/jit/passes/freeze_module.cpp
+++ b/torch/csrc/jit/passes/freeze_module.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/freeze_module.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/ir/alias_analysis.h>
diff --git a/torch/csrc/jit/passes/fuse_relu.cpp b/torch/csrc/jit/passes/fuse_relu.cpp
index 02e8f9f..479b4b2 100644
--- a/torch/csrc/jit/passes/fuse_relu.cpp
+++ b/torch/csrc/jit/passes/fuse_relu.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/fuse_relu.h>
+
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
diff --git a/torch/csrc/jit/passes/graph_rewrite_helper.cpp b/torch/csrc/jit/passes/graph_rewrite_helper.cpp
index 8b612a9..8072174 100644
--- a/torch/csrc/jit/passes/graph_rewrite_helper.cpp
+++ b/torch/csrc/jit/passes/graph_rewrite_helper.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/graph_rewrite_helper.h>
+
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/passes/constant_propagation.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
diff --git a/torch/csrc/jit/passes/graph_rewrite_helper.h b/torch/csrc/jit/passes/graph_rewrite_helper.h
index f21859d..57b91be 100644
--- a/torch/csrc/jit/passes/graph_rewrite_helper.h
+++ b/torch/csrc/jit/passes/graph_rewrite_helper.h
@@ -39,10 +39,11 @@
static PatternInfo parse_from_str(
std::string pattern_string,
const std::vector<MatchFilter>& filters = {}) {
- PatternInfo rv{std::move(pattern_string),
- std::make_unique<Graph>(),
- decltype(vmap){},
- filters};
+ PatternInfo rv{
+ std::move(pattern_string),
+ std::make_unique<Graph>(),
+ decltype(vmap){},
+ filters};
parseIR(rv.pattern_string, rv.pattern_graph.get(), rv.vmap);
return rv;
}
diff --git a/torch/csrc/jit/passes/guard_elimination.cpp b/torch/csrc/jit/passes/guard_elimination.cpp
index 9ae808e4..c26404d 100644
--- a/torch/csrc/jit/passes/guard_elimination.cpp
+++ b/torch/csrc/jit/passes/guard_elimination.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/guard_elimination.h>
+
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/constant_propagation.h>
diff --git a/torch/csrc/jit/passes/inline_forked_closures.cpp b/torch/csrc/jit/passes/inline_forked_closures.cpp
index e97d71e..7710500 100644
--- a/torch/csrc/jit/passes/inline_forked_closures.cpp
+++ b/torch/csrc/jit/passes/inline_forked_closures.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/inline_forked_closures.h>
+
#include <torch/csrc/jit/frontend/ir_emitter.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/inliner.cpp b/torch/csrc/jit/passes/inliner.cpp
index 02edaa7..2d510bd 100644
--- a/torch/csrc/jit/passes/inliner.cpp
+++ b/torch/csrc/jit/passes/inliner.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/inliner.h>
+
#include <torch/csrc/jit/api/module.h>
#include <torch/csrc/jit/frontend/error_report.h>
#include <torch/csrc/jit/jit_log.h>
diff --git a/torch/csrc/jit/passes/lift_closures.cpp b/torch/csrc/jit/passes/lift_closures.cpp
index 4f5941c..09ac524 100644
--- a/torch/csrc/jit/passes/lift_closures.cpp
+++ b/torch/csrc/jit/passes/lift_closures.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/lift_closures.h>
+
#include <torch/csrc/jit/frontend/ir_emitter.h>
#include <torch/csrc/jit/ir/ir.h>
diff --git a/torch/csrc/jit/passes/liveness.cpp b/torch/csrc/jit/passes/liveness.cpp
index e580eb4..3b2cf54 100644
--- a/torch/csrc/jit/passes/liveness.cpp
+++ b/torch/csrc/jit/passes/liveness.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/liveness.h>
+
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/ir/ir_views.h>
#include <torch/csrc/jit/passes/constant_pooling.h>
diff --git a/torch/csrc/jit/passes/lower_grad_of.cpp b/torch/csrc/jit/passes/lower_grad_of.cpp
index d9bdd91..3f3de5f 100644
--- a/torch/csrc/jit/passes/lower_grad_of.cpp
+++ b/torch/csrc/jit/passes/lower_grad_of.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/lower_grad_of.h>
+
#include <torch/csrc/jit/jit_log.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/lower_graph.cpp b/torch/csrc/jit/passes/lower_graph.cpp
index 581f4d1..b4da821 100644
--- a/torch/csrc/jit/passes/lower_graph.cpp
+++ b/torch/csrc/jit/passes/lower_graph.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/lower_graph.h>
+
#include <torch/csrc/jit/api/object.h>
#include <torch/csrc/jit/frontend/error_report.h>
#include <torch/csrc/jit/passes/inliner.h>
diff --git a/torch/csrc/jit/passes/lower_tuples.cpp b/torch/csrc/jit/passes/lower_tuples.cpp
index d241e0d..2fc61d3 100644
--- a/torch/csrc/jit/passes/lower_tuples.cpp
+++ b/torch/csrc/jit/passes/lower_tuples.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/lower_tuples.h>
+
#include <ATen/core/functional.h>
#include <c10/util/Exception.h>
#include <torch/csrc/jit/ir/constants.h>
diff --git a/torch/csrc/jit/passes/normalize_ops.cpp b/torch/csrc/jit/passes/normalize_ops.cpp
index e032eeb..a2ea0a7 100644
--- a/torch/csrc/jit/passes/normalize_ops.cpp
+++ b/torch/csrc/jit/passes/normalize_ops.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/normalize_ops.h>
+
#include <c10/util/Exception.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/onnx.cpp b/torch/csrc/jit/passes/onnx.cpp
index 5bc0a2e..51476dc 100644
--- a/torch/csrc/jit/passes/onnx.cpp
+++ b/torch/csrc/jit/passes/onnx.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx.h>
+
#include <ATen/core/functional.h>
#include <c10/util/Exception.h>
#include <torch/csrc/autograd/function.h>
diff --git a/torch/csrc/jit/passes/onnx/constant_fold.cpp b/torch/csrc/jit/passes/onnx/constant_fold.cpp
index ffb98d9..66c8398 100644
--- a/torch/csrc/jit/passes/onnx/constant_fold.cpp
+++ b/torch/csrc/jit/passes/onnx/constant_fold.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/constant_fold.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/passes/onnx/helper.h>
diff --git a/torch/csrc/jit/passes/onnx/fixup_onnx_controlflow.cpp b/torch/csrc/jit/passes/onnx/fixup_onnx_controlflow.cpp
index 19523f5..b826db9 100644
--- a/torch/csrc/jit/passes/onnx/fixup_onnx_controlflow.cpp
+++ b/torch/csrc/jit/passes/onnx/fixup_onnx_controlflow.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/fixup_onnx_controlflow.h>
+
#include <aten/src/ATen/InitialTensorOptions.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
diff --git a/torch/csrc/jit/passes/onnx/function_substitution.cpp b/torch/csrc/jit/passes/onnx/function_substitution.cpp
index 6c51797..460deae 100644
--- a/torch/csrc/jit/passes/onnx/function_substitution.cpp
+++ b/torch/csrc/jit/passes/onnx/function_substitution.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/function_substitution.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/onnx/helper.h>
diff --git a/torch/csrc/jit/passes/onnx/helper.cpp b/torch/csrc/jit/passes/onnx/helper.cpp
index 07f71fc..a14dcd6 100644
--- a/torch/csrc/jit/passes/onnx/helper.cpp
+++ b/torch/csrc/jit/passes/onnx/helper.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/helper.h>
+
#include <onnx/onnx_pb.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/onnx/list_model_parameters.cpp b/torch/csrc/jit/passes/onnx/list_model_parameters.cpp
index 4f0b4e2..78cc7ae 100644
--- a/torch/csrc/jit/passes/onnx/list_model_parameters.cpp
+++ b/torch/csrc/jit/passes/onnx/list_model_parameters.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/list_model_parameters.h>
+
#include <torch/csrc/jit/frontend/error_report.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
diff --git a/torch/csrc/jit/passes/onnx/peephole.cpp b/torch/csrc/jit/passes/onnx/peephole.cpp
index e04a74a..3a0bc9a 100644
--- a/torch/csrc/jit/passes/onnx/peephole.cpp
+++ b/torch/csrc/jit/passes/onnx/peephole.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/peephole.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/passes/onnx/helper.h>
diff --git a/torch/csrc/jit/passes/onnx/prepare_division_for_onnx.cpp b/torch/csrc/jit/passes/onnx/prepare_division_for_onnx.cpp
index edbb159..709b174 100644
--- a/torch/csrc/jit/passes/onnx/prepare_division_for_onnx.cpp
+++ b/torch/csrc/jit/passes/onnx/prepare_division_for_onnx.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/prepare_division_for_onnx.h>
+
#include <torch/csrc/jit/ir/constants.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/onnx/preprocess_for_onnx.cpp b/torch/csrc/jit/passes/onnx/preprocess_for_onnx.cpp
index 8eb0746..ec98c01 100644
--- a/torch/csrc/jit/passes/onnx/preprocess_for_onnx.cpp
+++ b/torch/csrc/jit/passes/onnx/preprocess_for_onnx.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/preprocess_for_onnx.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/onnx/helper.h>
diff --git a/torch/csrc/jit/passes/onnx/scalar_type_analysis.cpp b/torch/csrc/jit/passes/onnx/scalar_type_analysis.cpp
index 1a63edf..e637169 100644
--- a/torch/csrc/jit/passes/onnx/scalar_type_analysis.cpp
+++ b/torch/csrc/jit/passes/onnx/scalar_type_analysis.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/scalar_type_analysis.h>
+
#include <torch/csrc/jit/passes/dead_code_elimination.h>
namespace torch {
diff --git a/torch/csrc/jit/passes/onnx/shape_type_inference.cpp b/torch/csrc/jit/passes/onnx/shape_type_inference.cpp
index e84901a..4c2bf32 100644
--- a/torch/csrc/jit/passes/onnx/shape_type_inference.cpp
+++ b/torch/csrc/jit/passes/onnx/shape_type_inference.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/shape_type_inference.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/onnx/helper.h>
#include <torch/csrc/jit/passes/onnx/scalar_type_analysis.h>
diff --git a/torch/csrc/jit/passes/onnx/unpack_quantized_weights.cpp b/torch/csrc/jit/passes/onnx/unpack_quantized_weights.cpp
index 0de7f36..b9b9fe1 100644
--- a/torch/csrc/jit/passes/onnx/unpack_quantized_weights.cpp
+++ b/torch/csrc/jit/passes/onnx/unpack_quantized_weights.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/onnx/unpack_quantized_weights.h>
+
#include <ATen/native/quantized/cpu/packed_params.h>
#include <torch/csrc/jit/ir/constants.h>
#include <torch/csrc/jit/ir/irparser.h>
@@ -25,20 +26,21 @@
double getScaleFromInput(Node* input_node) {
c10::optional<IValue> scale;
std::string input_name = input_node->kind().toQualString();
- std::unordered_set<std::string> noscale_ops = {"quantized::max_pool2d",
- "aten::max_pool2d",
- "aten::relu",
- "prim::ListUnpack",
- "aten::split_with_sizes",
- "quantized::nchw2nhwc",
- "quantized::nhwc2nchw",
- "aten::slice",
- "aten::avg_pool2d",
- "quantized::cat",
- "prim::ListConstruct",
- "aten::upsample_nearest2d",
- "aten::sigmoid",
- "aten::reshape"};
+ std::unordered_set<std::string> noscale_ops = {
+ "quantized::max_pool2d",
+ "aten::max_pool2d",
+ "aten::relu",
+ "prim::ListUnpack",
+ "aten::split_with_sizes",
+ "quantized::nchw2nhwc",
+ "quantized::nhwc2nchw",
+ "aten::slice",
+ "aten::avg_pool2d",
+ "quantized::cat",
+ "prim::ListConstruct",
+ "aten::upsample_nearest2d",
+ "aten::sigmoid",
+ "aten::reshape"};
if (input_name == "aten::quantize_per_tensor") {
TORCH_CHECK(
input_node->inputs().size() > 1,
@@ -273,10 +275,11 @@
std::vector<int64_t> wt_sizes = unpacked_weight.sizes().vec();
if (unpacked_weight.ndimension() == 4) {
unpacked_weight.permute({0, 2, 3, 1});
- wt_sizes = {unpacked_weight.size(0),
- unpacked_weight.size(2),
- unpacked_weight.size(3),
- unpacked_weight.size(1)};
+ wt_sizes = {
+ unpacked_weight.size(0),
+ unpacked_weight.size(2),
+ unpacked_weight.size(3),
+ unpacked_weight.size(1)};
}
// Remove packed_params
diff --git a/torch/csrc/jit/passes/peephole.cpp b/torch/csrc/jit/passes/peephole.cpp
index 167173d..7c659f5 100644
--- a/torch/csrc/jit/passes/peephole.cpp
+++ b/torch/csrc/jit/passes/peephole.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/peephole.h>
+
#include <ATen/core/jit_type.h>
#include <torch/csrc/jit/ir/alias_analysis.h>
#include <torch/csrc/jit/ir/ir_views.h>
diff --git a/torch/csrc/jit/passes/quantization/dedup_module_uses.cpp b/torch/csrc/jit/passes/quantization/dedup_module_uses.cpp
index c3b78a0..2f20dc8 100644
--- a/torch/csrc/jit/passes/quantization/dedup_module_uses.cpp
+++ b/torch/csrc/jit/passes/quantization/dedup_module_uses.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/quantization/dedup_module_uses.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/quantization/helper.h>
diff --git a/torch/csrc/jit/passes/quantization/finalize.cpp b/torch/csrc/jit/passes/quantization/finalize.cpp
index 0f12e94..af4a7bb 100644
--- a/torch/csrc/jit/passes/quantization/finalize.cpp
+++ b/torch/csrc/jit/passes/quantization/finalize.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/quantization/finalize.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/clear_profiling.h>
#include <torch/csrc/jit/passes/freeze_module.h>
diff --git a/torch/csrc/jit/passes/quantization/helper.cpp b/torch/csrc/jit/passes/quantization/helper.cpp
index 10e46ae..1549b4f 100644
--- a/torch/csrc/jit/passes/quantization/helper.cpp
+++ b/torch/csrc/jit/passes/quantization/helper.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/quantization/helper.h>
+
#include <torch/csrc/jit/passes/graph_rewrite_helper.h>
namespace torch {
@@ -176,17 +177,19 @@
std::tuple<c10::QScheme, QParamVector> _per_tensor_asym_qparam =
std::make_tuple(
c10::kPerTensorAffine,
- QParamVector({std::make_pair(".scale", IValue(_asym_scale)),
- std::make_pair(".zero_point", IValue(_asym_zero_point)),
- std::make_pair(".scalar_type", IValue(c10::kQUInt8))}));
+ QParamVector(
+ {std::make_pair(".scale", IValue(_asym_scale)),
+ std::make_pair(".zero_point", IValue(_asym_zero_point)),
+ std::make_pair(".scalar_type", IValue(c10::kQUInt8))}));
// quantization parrameters for ops with range -1 to 1
// for example: aten/src/ATen/native/quantized/cpu/qtanh.cpp
std::tuple<c10::QScheme, QParamVector> _per_tensor_sym_qparam = std::make_tuple(
c10::kPerTensorAffine,
- QParamVector({std::make_pair(".scale", IValue(_sym_scale)),
- std::make_pair(".zero_point", IValue(_sym_zero_point)),
- std::make_pair(".scalar_type", IValue(c10::kQUInt8))}));
+ QParamVector(
+ {std::make_pair(".scale", IValue(_sym_scale)),
+ std::make_pair(".zero_point", IValue(_sym_zero_point)),
+ std::make_pair(".scalar_type", IValue(c10::kQUInt8))}));
// Map from aten op symbol to the quantization parameters
// for the ops with fixed quantization parameters
@@ -218,10 +221,11 @@
// the inputs are quantized
// if the second input is a Scalar, we'll only look at the first input to decide
// if we need to quantize the output
-std::vector<std::string> _propagate_quant_binary_ops = {"add",
- "add_",
- "mul",
- "mul_"};
+std::vector<std::string> _propagate_quant_binary_ops = {
+ "add",
+ "add_",
+ "mul",
+ "mul_"};
// Check if `use` is an aten function of name `func_name` and if value
// `v` is the nth argument (if provided) of the function.
@@ -272,13 +276,14 @@
v,
// ate::embedding_bag(%weight, %input, %offsets, %scale_grad_by_freq,
// %mode_enum, %sparse, %per_sample_weights, %include_last_offset)
- AtenFuncArgs({{"conv1d", 1},
- {"conv2d", 1},
- {"conv3d", 1},
- {"conv_transpose1d", 1},
- {"conv_transpose2d", 1},
- {"linear", 1},
- {"embedding_bag", 0}}),
+ AtenFuncArgs(
+ {{"conv1d", 1},
+ {"conv2d", 1},
+ {"conv3d", 1},
+ {"conv_transpose1d", 1},
+ {"conv_transpose2d", 1},
+ {"linear", 1},
+ {"embedding_bag", 0}}),
// embedding_bag - prim::CallFunction(%func, %input.1, %weight,
// %offsets.1, %max_norm, %norm_type, %scale_grad_by_freq, %mode, %sparse,
// %per_sample_weights.1, %include_last_offset)
@@ -289,12 +294,13 @@
bool isBiasOfConvOrLinear(Value* v) {
bool result = matchArgPattern(
v,
- AtenFuncArgs({{"conv1d", 2},
- {"conv2d", 2},
- {"conv3d", 2},
- {"conv_transpose1d", 2},
- {"conv_transpose2d", 2},
- {"linear", 2}}),
+ AtenFuncArgs(
+ {{"conv1d", 2},
+ {"conv2d", 2},
+ {"conv3d", 2},
+ {"conv_transpose1d", 2},
+ {"conv_transpose2d", 2},
+ {"linear", 2}}),
CallFuncArgs({{"linear", 3}}));
return result;
}
diff --git a/torch/csrc/jit/passes/quantization/insert_observers.cpp b/torch/csrc/jit/passes/quantization/insert_observers.cpp
index bacd8cf..649869c 100644
--- a/torch/csrc/jit/passes/quantization/insert_observers.cpp
+++ b/torch/csrc/jit/passes/quantization/insert_observers.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/quantization/insert_observers.h>
+
#include <torch/csrc/jit/frontend/schema_matching.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/jit_log.h>
diff --git a/torch/csrc/jit/passes/quantization/insert_quant_dequant.cpp b/torch/csrc/jit/passes/quantization/insert_quant_dequant.cpp
index 0d2c1c2..53a13b6 100644
--- a/torch/csrc/jit/passes/quantization/insert_quant_dequant.cpp
+++ b/torch/csrc/jit/passes/quantization/insert_quant_dequant.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/quantization/insert_quant_dequant.h>
+
#include <c10/core/QScheme.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
#include <torch/csrc/jit/jit_log.h>
@@ -1122,10 +1123,11 @@
"q_zero_point");
Node* dtype = insertQParam(
graph, quantized_input, prim::dtype, IntType::get(), "dtype");
- quant_inputs = {original_output,
- scale->output(),
- zero_point->output(),
- dtype->output()};
+ quant_inputs = {
+ original_output,
+ scale->output(),
+ zero_point->output(),
+ dtype->output()};
}
Node* quant = insertQuant(
graph, quant_inputs, quant_kind, original_output->debugName() + ".quant");
diff --git a/torch/csrc/jit/passes/requires_grad_analysis.cpp b/torch/csrc/jit/passes/requires_grad_analysis.cpp
index deb7837..12c1b7b 100644
--- a/torch/csrc/jit/passes/requires_grad_analysis.cpp
+++ b/torch/csrc/jit/passes/requires_grad_analysis.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/requires_grad_analysis.h>
+
#include <ATen/core/jit_type.h>
#include <torch/csrc/autograd/autograd.h>
#include <torch/csrc/jit/ir/constants.h>
diff --git a/torch/csrc/jit/passes/shape_analysis.cpp b/torch/csrc/jit/passes/shape_analysis.cpp
index fd076ca..a720f93 100644
--- a/torch/csrc/jit/passes/shape_analysis.cpp
+++ b/torch/csrc/jit/passes/shape_analysis.cpp
@@ -1270,9 +1270,10 @@
type->withScalarType(maybe_dtype_option->toScalarType())};
}
if (type->scalarType()) {
- return {at::isFloatingType(*type->scalarType())
- ? type
- : type->withScalarType(at::kLong)};
+ return {
+ at::isFloatingType(*type->scalarType())
+ ? type
+ : type->withScalarType(at::kLong)};
} else {
return {type};
}
diff --git a/torch/csrc/jit/passes/specialize_autogradzero.cpp b/torch/csrc/jit/passes/specialize_autogradzero.cpp
index 38d0913..6e660a3 100644
--- a/torch/csrc/jit/passes/specialize_autogradzero.cpp
+++ b/torch/csrc/jit/passes/specialize_autogradzero.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/specialize_autogradzero.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/jit_log.h>
diff --git a/torch/csrc/jit/passes/subgraph_rewrite.cpp b/torch/csrc/jit/passes/subgraph_rewrite.cpp
index ff066a8..45d07fe 100644
--- a/torch/csrc/jit/passes/subgraph_rewrite.cpp
+++ b/torch/csrc/jit/passes/subgraph_rewrite.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
+
#include <torch/csrc/jit/ir/irparser.h>
#include <torch/csrc/jit/ir/subgraph_matcher.h>
diff --git a/torch/csrc/jit/passes/tensorexpr_fuser.cpp b/torch/csrc/jit/passes/tensorexpr_fuser.cpp
index b8b6f72..7b7de1e 100644
--- a/torch/csrc/jit/passes/tensorexpr_fuser.cpp
+++ b/torch/csrc/jit/passes/tensorexpr_fuser.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/tensorexpr_fuser.h>
+
#include <ATen/record_function.h>
#include <c10/util/FunctionRef.h>
#include <torch/csrc/jit/codegen/fuser/interface.h>
diff --git a/torch/csrc/jit/passes/update_differentiable_graph_requires_grad.cpp b/torch/csrc/jit/passes/update_differentiable_graph_requires_grad.cpp
index 805f9e2..5013dcf 100644
--- a/torch/csrc/jit/passes/update_differentiable_graph_requires_grad.cpp
+++ b/torch/csrc/jit/passes/update_differentiable_graph_requires_grad.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/update_differentiable_graph_requires_grad.h>
+
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/passes/utils/subgraph_utils.h>
diff --git a/torch/csrc/jit/passes/utils/check_alias_annotation.cpp b/torch/csrc/jit/passes/utils/check_alias_annotation.cpp
index 40aa7db..78ab4a6 100644
--- a/torch/csrc/jit/passes/utils/check_alias_annotation.cpp
+++ b/torch/csrc/jit/passes/utils/check_alias_annotation.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/utils/check_alias_annotation.h>
+
#include <torch/csrc/jit/passes/constant_propagation.h>
#include <torch/csrc/jit/passes/normalize_ops.h>
#include <torch/csrc/jit/runtime/operator.h>
diff --git a/torch/csrc/jit/passes/utils/subgraph_utils.cpp b/torch/csrc/jit/passes/utils/subgraph_utils.cpp
index d104bb7..bee1d50 100644
--- a/torch/csrc/jit/passes/utils/subgraph_utils.cpp
+++ b/torch/csrc/jit/passes/utils/subgraph_utils.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/passes/utils/subgraph_utils.h>
+
#include <torch/csrc/jit/passes/canonicalize.h>
namespace torch {
diff --git a/torch/csrc/jit/python/python_custom_class.cpp b/torch/csrc/jit/python/python_custom_class.cpp
index 9809b85..a4120d4 100644
--- a/torch/csrc/jit/python/python_custom_class.cpp
+++ b/torch/csrc/jit/python/python_custom_class.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/python/python_custom_class.h>
+
#include <torch/csrc/jit/frontend/sugared_value.h>
#include <fmt/format.h>
diff --git a/torch/csrc/jit/python/python_ir.cpp b/torch/csrc/jit/python/python_ir.cpp
index b6f6169..495de26 100644
--- a/torch/csrc/jit/python/python_ir.cpp
+++ b/torch/csrc/jit/python/python_ir.cpp
@@ -568,14 +568,12 @@
.AS(removeAttribute)
.AS(attributeNames)
#undef AS
-#define CREATE_ACCESSOR(Kind, method) \
- def(#method "_", \
- [](Node& n, const char* name, Kind##Attr::ValueType v) { \
- return n.method##_(Symbol::attr(name), std::move(v)); \
- }) \
- .def(#method, [](Node& n, const char* name) { \
- return n.method(Symbol::attr(name)); \
- })
+#define CREATE_ACCESSOR(Kind, method) \
+ def(#method "_", [](Node& n, const char* name, Kind##Attr::ValueType v) { \
+ return n.method##_(Symbol::attr(name), std::move(v)); \
+ }).def(#method, [](Node& n, const char* name) { \
+ return n.method(Symbol::attr(name)); \
+ })
.CREATE_ACCESSOR(Float, f)
.CREATE_ACCESSOR(Floats, fs)
.CREATE_ACCESSOR(String, s)
diff --git a/torch/csrc/jit/python/python_sugared_value.cpp b/torch/csrc/jit/python/python_sugared_value.cpp
index 056e23d..f6f6fbf 100644
--- a/torch/csrc/jit/python/python_sugared_value.cpp
+++ b/torch/csrc/jit/python/python_sugared_value.cpp
@@ -223,13 +223,14 @@
Function& m,
const std::string& field) {
// List of all the cuda operators which are supported in JIT
- const std::unordered_set<std::string> cuda_ops = {"current_stream",
- "default_stream",
- "_current_device",
- "_set_device",
- "device_index",
- "device_count",
- "set_stream"};
+ const std::unordered_set<std::string> cuda_ops = {
+ "current_stream",
+ "default_stream",
+ "_current_device",
+ "_set_device",
+ "device_index",
+ "device_count",
+ "set_stream"};
if (cuda_ops.find(field) != cuda_ops.end()) {
return std::make_shared<BuiltinFunction>(Symbol::cuda(field), c10::nullopt);
diff --git a/torch/csrc/jit/runtime/autodiff.cpp b/torch/csrc/jit/runtime/autodiff.cpp
index 9e6ac44..c3eebdf 100644
--- a/torch/csrc/jit/runtime/autodiff.cpp
+++ b/torch/csrc/jit/runtime/autodiff.cpp
@@ -253,12 +253,13 @@
graph->insertNode(graph->createTupleUnpack(backward_value));
auto tuple_outputs = tuple_unpack_node->outputs();
AT_ASSERT(tuple_outputs.size() == size_t(3));
- return {tuple_outputs[0],
- tuple_outputs[1],
- nullptr,
- tuple_outputs[2],
- nullptr,
- nullptr};
+ return {
+ tuple_outputs[0],
+ tuple_outputs[1],
+ nullptr,
+ tuple_outputs[2],
+ nullptr,
+ nullptr};
} else if (
node->matches(
@@ -282,14 +283,15 @@
graph->insertNode(graph->createTupleUnpack(backward_value));
auto tuple_outputs = tuple_unpack_node->outputs();
AT_ASSERT(tuple_outputs.size() == size_t(3));
- return {tuple_outputs[0],
- tuple_outputs[1],
- tuple_outputs[2],
- nullptr,
- nullptr,
- nullptr,
- nullptr,
- nullptr};
+ return {
+ tuple_outputs[0],
+ tuple_outputs[1],
+ tuple_outputs[2],
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr};
}
throw std::runtime_error(
diff --git a/torch/csrc/jit/runtime/logging.h b/torch/csrc/jit/runtime/logging.h
index ce03394..a59e809 100644
--- a/torch/csrc/jit/runtime/logging.h
+++ b/torch/csrc/jit/runtime/logging.h
@@ -74,10 +74,11 @@
"pytorch_runtime.execution_plan_cache_miss";
inline std::vector<const char*> allRuntimeCounters() {
- return {GRAPH_EXECUTORS_CONSTRUCTED,
- GRAPH_EXECUTOR_INVOCATIONS,
- EXECUTION_PLAN_CACHE_HIT,
- EXECUTION_PLAN_CACHE_MISS};
+ return {
+ GRAPH_EXECUTORS_CONSTRUCTED,
+ GRAPH_EXECUTOR_INVOCATIONS,
+ EXECUTION_PLAN_CACHE_HIT,
+ EXECUTION_PLAN_CACHE_MISS};
}
} // namespace runtime_counters
diff --git a/torch/csrc/jit/runtime/operator.cpp b/torch/csrc/jit/runtime/operator.cpp
index 1964679..49db701 100644
--- a/torch/csrc/jit/runtime/operator.cpp
+++ b/torch/csrc/jit/runtime/operator.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/operator.h>
+
#include <ATen/ATen.h>
#include <ATen/core/alias_info.h>
#include <torch/csrc/jit/frontend/edit_distance.h>
diff --git a/torch/csrc/jit/runtime/profiling_graph_executor_impl.cpp b/torch/csrc/jit/runtime/profiling_graph_executor_impl.cpp
index dec64c4..aed5d9c 100644
--- a/torch/csrc/jit/runtime/profiling_graph_executor_impl.cpp
+++ b/torch/csrc/jit/runtime/profiling_graph_executor_impl.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/profiling_graph_executor_impl.h>
+
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/bailout_graph.h>
#include <torch/csrc/jit/passes/batch_mm.h>
diff --git a/torch/csrc/jit/runtime/profiling_record.cpp b/torch/csrc/jit/runtime/profiling_record.cpp
index 12e805c..273b242 100644
--- a/torch/csrc/jit/runtime/profiling_record.cpp
+++ b/torch/csrc/jit/runtime/profiling_record.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/profiling_record.h>
+
#include <ATen/core/interned_strings.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/clear_profiling.h>
diff --git a/torch/csrc/jit/runtime/register_prim_ops.cpp b/torch/csrc/jit/runtime/register_prim_ops.cpp
index fe75ec5..07c7445 100644
--- a/torch/csrc/jit/runtime/register_prim_ops.cpp
+++ b/torch/csrc/jit/runtime/register_prim_ops.cpp
@@ -112,7 +112,7 @@
// depends on the type hint and input. The implementation of this
// operator below is intended to be as close to the Python
// implementation in torch/csrc/utils/tensor_list.cpp as possible.
- [](const Node * /*node*/) -> Operation {
+ [](const Node* /*node*/) -> Operation {
return [](Stack* stack) {
int elem_ty_val;
int dim_val;
diff --git a/torch/csrc/jit/runtime/register_prim_ops_fulljit.cpp b/torch/csrc/jit/runtime/register_prim_ops_fulljit.cpp
index 8361fb3..2de6299 100644
--- a/torch/csrc/jit/runtime/register_prim_ops_fulljit.cpp
+++ b/torch/csrc/jit/runtime/register_prim_ops_fulljit.cpp
@@ -66,7 +66,7 @@
aliasAnalysisSpecialCase()),
Operator(
prim::TypeCheck /* (...) -> (..., bool) */,
- [](const Node * /* node */) -> Operation {
+ [](const Node* /* node */) -> Operation {
return [](Stack* /* stack */) {
AT_ERROR("prim::TypeCheck not yet implemented"); // NOLINT
};
diff --git a/torch/csrc/jit/runtime/slice_indices_adjust.cpp b/torch/csrc/jit/runtime/slice_indices_adjust.cpp
index e71d6ba..8c0d391 100644
--- a/torch/csrc/jit/runtime/slice_indices_adjust.cpp
+++ b/torch/csrc/jit/runtime/slice_indices_adjust.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/slice_indices_adjust.h>
+
#include <c10/util/Exception.h>
#include <cstdint>
diff --git a/torch/csrc/jit/runtime/static/fusion.cpp b/torch/csrc/jit/runtime/static/fusion.cpp
index 5050b8d..b4ef21e 100644
--- a/torch/csrc/jit/runtime/static/fusion.cpp
+++ b/torch/csrc/jit/runtime/static/fusion.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/static/fusion.h>
+
#include <ATen/core/interned_strings.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
diff --git a/torch/csrc/jit/runtime/static/impl.cpp b/torch/csrc/jit/runtime/static/impl.cpp
index a398f8e..8160e3a 100644
--- a/torch/csrc/jit/runtime/static/impl.cpp
+++ b/torch/csrc/jit/runtime/static/impl.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/static/impl.h>
+
#include <ATen/core/LegacyTypeDispatch.h>
#include <ATen/core/interned_strings.h>
#include <c10/core/CPUAllocator.h>
@@ -306,8 +307,8 @@
const std::shared_ptr<torch::jit::Graph>& graph,
const std::unordered_map<Value*, size_t>& value_to_reg,
std::vector<size_t>& internals) {
- std::unordered_set<Value*> outputs{graph->outputs().begin(),
- graph->outputs().end()};
+ std::unordered_set<Value*> outputs{
+ graph->outputs().begin(), graph->outputs().end()};
for (Node* node : graph->nodes()) {
if (node->kind() != prim::Constant) {
for (Value* output : node->outputs()) {
diff --git a/torch/csrc/jit/runtime/static/init.cpp b/torch/csrc/jit/runtime/static/init.cpp
index 4799b5b..9027549 100644
--- a/torch/csrc/jit/runtime/static/init.cpp
+++ b/torch/csrc/jit/runtime/static/init.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/static/init.h>
+
#include <torch/csrc/jit/passes/freeze_module.h>
#include <torch/csrc/jit/runtime/static/fusion.h>
#include <torch/csrc/jit/runtime/static/impl.h>
diff --git a/torch/csrc/jit/runtime/static/ops.cpp b/torch/csrc/jit/runtime/static/ops.cpp
index 3e21224..2d4dc67 100644
--- a/torch/csrc/jit/runtime/static/ops.cpp
+++ b/torch/csrc/jit/runtime/static/ops.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/static/ops.h>
+
#include <ATen/NativeFunctions.h>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/runtime/vararg_functions.h>
diff --git a/torch/csrc/jit/runtime/static/passes.cpp b/torch/csrc/jit/runtime/static/passes.cpp
index bbaaa66..0ef2e3a 100644
--- a/torch/csrc/jit/runtime/static/passes.cpp
+++ b/torch/csrc/jit/runtime/static/passes.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/static/passes.h>
+
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
namespace torch {
diff --git a/torch/csrc/jit/runtime/symbolic_script.cpp b/torch/csrc/jit/runtime/symbolic_script.cpp
index 6887be5..1113d45 100644
--- a/torch/csrc/jit/runtime/symbolic_script.cpp
+++ b/torch/csrc/jit/runtime/symbolic_script.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/symbolic_script.h>
+
#include <torch/csrc/jit/frontend/ir_emitter.h>
#include <torch/csrc/jit/runtime/operator.h>
diff --git a/torch/csrc/jit/runtime/vararg_functions.cpp b/torch/csrc/jit/runtime/vararg_functions.cpp
index 930ea5e..2bb8840 100644
--- a/torch/csrc/jit/runtime/vararg_functions.cpp
+++ b/torch/csrc/jit/runtime/vararg_functions.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/runtime/vararg_functions.h>
+
#include <ATen/ATen.h>
namespace torch {
@@ -186,8 +187,9 @@
}
void tupleConstruct(Stack& stack, size_t num_inputs) {
- std::vector<IValue> elems{std::make_move_iterator(stack.end() - num_inputs),
- std::make_move_iterator(stack.end())};
+ std::vector<IValue> elems{
+ std::make_move_iterator(stack.end() - num_inputs),
+ std::make_move_iterator(stack.end())};
drop(stack, num_inputs);
push(stack, c10::ivalue::Tuple::create(std::move(elems)));
}
@@ -196,8 +198,9 @@
Stack& stack,
at::TupleTypePtr type,
size_t num_inputs) {
- std::vector<IValue> elems{std::make_move_iterator(stack.end() - num_inputs),
- std::make_move_iterator(stack.end())};
+ std::vector<IValue> elems{
+ std::make_move_iterator(stack.end() - num_inputs),
+ std::make_move_iterator(stack.end())};
drop(stack, num_inputs);
push(
stack,
diff --git a/torch/csrc/jit/serialization/export.cpp b/torch/csrc/jit/serialization/export.cpp
index b69a5b7..2afccb3 100644
--- a/torch/csrc/jit/serialization/export.cpp
+++ b/torch/csrc/jit/serialization/export.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/serialization/export.h>
+
#include <torch/csrc/autograd/symbolic.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/serialization/import_export_constants.h>
diff --git a/torch/csrc/jit/serialization/export_module.cpp b/torch/csrc/jit/serialization/export_module.cpp
index 493f3e5..0dd3ba2 100644
--- a/torch/csrc/jit/serialization/export_module.cpp
+++ b/torch/csrc/jit/serialization/export_module.cpp
@@ -169,9 +169,10 @@
auto method_name_idx =
code.constant_table().size() + method_names.size();
method_names.emplace_back(node->s(attr::name));
- Instruction new_instr{INTERFACE_CALL,
- static_cast<int32_t>(method_name_idx),
- static_cast<uint16_t>(node->inputs().size())};
+ Instruction new_instr{
+ INTERFACE_CALL,
+ static_cast<int32_t>(method_name_idx),
+ static_cast<uint16_t>(node->inputs().size())};
instructions_copy[i] = new_instr;
} else {
TORCH_INTERNAL_ASSERT(
@@ -271,11 +272,12 @@
// register size
auto register_size = static_cast<int>(code.register_size());
- auto table = Table({{"instructions", Tup(instructions)},
- {"operators", Tup(operators)},
- {"constants", Tup(deduplicated_constants)},
- {"types", Tup(types)},
- {"register_size", register_size}});
+ auto table = Table(
+ {{"instructions", Tup(instructions)},
+ {"operators", Tup(operators)},
+ {"constants", Tup(deduplicated_constants)},
+ {"types", Tup(types)},
+ {"register_size", register_size}});
auto bytecode_vals = Tup({func.qualname().qualifiedName(), table});
c10::optional<IValue> debug_info_vals;
diff --git a/torch/csrc/jit/serialization/import.cpp b/torch/csrc/jit/serialization/import.cpp
index ed5dde0..159ded3 100644
--- a/torch/csrc/jit/serialization/import.cpp
+++ b/torch/csrc/jit/serialization/import.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/serialization/import.h>
+
#include <ATen/core/functional.h>
#include <ATen/core/ivalue_inl.h>
#include <c10/util/Exception.h>
diff --git a/torch/csrc/jit/serialization/import_export_helpers.cpp b/torch/csrc/jit/serialization/import_export_helpers.cpp
index 3f09d1f..e12e937 100644
--- a/torch/csrc/jit/serialization/import_export_helpers.cpp
+++ b/torch/csrc/jit/serialization/import_export_helpers.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/serialization/import_export_helpers.h>
+
#include <caffe2/serialize/inline_container.h>
#include <torch/csrc/jit/frontend/source_range.h>
#include <torch/csrc/jit/serialization/source_range_serialization_impl.h>
diff --git a/torch/csrc/jit/serialization/pickle.cpp b/torch/csrc/jit/serialization/pickle.cpp
index 0e3284b..27b5fe2 100644
--- a/torch/csrc/jit/serialization/pickle.cpp
+++ b/torch/csrc/jit/serialization/pickle.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/serialization/pickle.h>
+
#include <ATen/core/ivalue.h>
#include <caffe2/serialize/inline_container.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
diff --git a/torch/csrc/jit/serialization/python_print.cpp b/torch/csrc/jit/serialization/python_print.cpp
index 18d656c..8b348de 100644
--- a/torch/csrc/jit/serialization/python_print.cpp
+++ b/torch/csrc/jit/serialization/python_print.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/serialization/python_print.h>
+
#include <ATen/core/qualified_name.h>
#include <c10/util/Exception.h>
#include <c10/util/StringUtil.h>
diff --git a/torch/csrc/jit/serialization/source_range_serialization.cpp b/torch/csrc/jit/serialization/source_range_serialization.cpp
index 16d3de4..9f158e4 100644
--- a/torch/csrc/jit/serialization/source_range_serialization.cpp
+++ b/torch/csrc/jit/serialization/source_range_serialization.cpp
@@ -87,8 +87,8 @@
std::vector<char> SourceRangePickler::pickle(const SourceRangeRecords& ranges) {
std::vector<c10::IValue> ivalues;
for (const auto& range : ranges) {
- std::vector<c10::IValue> row_elems{(int64_t)range.bytes,
- srs->serialize(range.range)};
+ std::vector<c10::IValue> row_elems{
+ (int64_t)range.bytes, srs->serialize(range.range)};
ivalues.emplace_back(c10::ivalue::Tuple::create(std::move(row_elems)));
}
std::vector<at::Tensor> table;
diff --git a/torch/csrc/jit/tensorexpr/cuda_codegen.h b/torch/csrc/jit/tensorexpr/cuda_codegen.h
index b070dd3..acaa5dd 100644
--- a/torch/csrc/jit/tensorexpr/cuda_codegen.h
+++ b/torch/csrc/jit/tensorexpr/cuda_codegen.h
@@ -73,12 +73,14 @@
public:
explicit GPUMetaVarRewriter(const CudaAnalysis* cuda_analysis)
: cuda_analysis_(cuda_analysis) {
- gpu_block_vars_ = {new Var("blockIdx.x", kInt),
- new Var("blockIdx.y", kInt),
- new Var("blockIdx.z", kInt)};
- gpu_thread_vars_ = {new Var("threadIdx.x", kInt),
- new Var("threadIdx.y", kInt),
- new Var("threadIdx.z", kInt)};
+ gpu_block_vars_ = {
+ new Var("blockIdx.x", kInt),
+ new Var("blockIdx.y", kInt),
+ new Var("blockIdx.z", kInt)};
+ gpu_thread_vars_ = {
+ new Var("threadIdx.x", kInt),
+ new Var("threadIdx.y", kInt),
+ new Var("threadIdx.z", kInt)};
current_block_reach_ = {new IntImm(1), new IntImm(1), new IntImm(1)};
current_thread_reach_ = {new IntImm(1), new IntImm(1), new IntImm(1)};
diff --git a/torch/csrc/jit/tensorexpr/llvm_codegen.cpp b/torch/csrc/jit/tensorexpr/llvm_codegen.cpp
index adc3be9..c1e7508 100644
--- a/torch/csrc/jit/tensorexpr/llvm_codegen.cpp
+++ b/torch/csrc/jit/tensorexpr/llvm_codegen.cpp
@@ -1,6 +1,7 @@
#ifdef TORCH_ENABLE_LLVM
#include <torch/csrc/jit/tensorexpr/llvm_codegen.h>
+
#include <c10/util/Exception.h>
#include <torch/csrc/jit/tensorexpr/llvm_jit.h>
diff --git a/torch/csrc/jit/tensorexpr/loopnest.cpp b/torch/csrc/jit/tensorexpr/loopnest.cpp
index c2b274a..f4f346f 100644
--- a/torch/csrc/jit/tensorexpr/loopnest.cpp
+++ b/torch/csrc/jit/tensorexpr/loopnest.cpp
@@ -2296,8 +2296,8 @@
For* root_for = nullptr;
For* target_for = nullptr;
- std::set<const Var*> reduce_args = {reduce_op->reduce_args().begin(),
- reduce_op->reduce_args().end()};
+ std::set<const Var*> reduce_args = {
+ reduce_op->reduce_args().begin(), reduce_op->reduce_args().end()};
// Store loops below the target point.
std::vector<const For*> output_loops;
diff --git a/torch/csrc/jit/testing/hooks_for_testing.cpp b/torch/csrc/jit/testing/hooks_for_testing.cpp
index 29dbc69..553938a 100644
--- a/torch/csrc/jit/testing/hooks_for_testing.cpp
+++ b/torch/csrc/jit/testing/hooks_for_testing.cpp
@@ -1,4 +1,5 @@
#include <torch/csrc/jit/testing/hooks_for_testing.h>
+
#include <torch/csrc/jit/api/module.h>
namespace torch {