Skip to content

Commit 3f3b171

Browse files
committed
lint
1 parent 7351b90 commit 3f3b171

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

runtime/executor/method_meta.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ size_t calculate_nbytes(
6262
n *= sizes[i];
6363
// Check for overflow
6464
ET_CHECK_MSG(
65-
sizes[i] == 0 || n / sizes[i] == prev_n,
66-
"overflow in calculate_nbytes");
65+
sizes[i] == 0 || n / sizes[i] == prev_n,
66+
"overflow in calculate_nbytes");
6767
}
6868

6969
size_t elem_size = executorch::runtime::elementSize(scalar_type);
@@ -73,9 +73,9 @@ size_t calculate_nbytes(
7373

7474
// Check for overflow before multiplying by element size
7575
ET_CHECK_MSG(
76-
elem_size == 0 || n / elem_size == prev_n,
77-
"overflow in calculate_nbytes");
78-
76+
elem_size == 0 || n / elem_size == prev_n,
77+
"overflow in calculate_nbytes");
78+
7979
return n;
8080
}
8181

runtime/executor/method_meta.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ struct ExecutionPlan;
2222
namespace executorch {
2323
namespace ET_RUNTIME_NAMESPACE {
2424
namespace testing {
25-
// Provides test access to private Program methods.
26-
class TensorInfoTestFriend;
27-
} // namespace testing
25+
// Provides test access to private Program methods.
26+
class TensorInfoTestFriend;
27+
} // namespace testing
2828

2929
/**
3030
* Metadata about a specific tensor of an ExecuTorch Program.

runtime/executor/test/method_meta_test.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ namespace runtime {
3232
namespace testing {
3333
// Provides access to private TensorInfo methods.
3434
class TensorInfoTestFriend final {
35-
public:
35+
public:
3636
ET_NODISCARD static TensorInfo get(
37-
Span<const int32_t> sizes,
38-
Span<const uint8_t> dim_order,
39-
executorch::aten::ScalarType scalar_type,
40-
const bool is_memory_planned,
41-
executorch::aten::string_view name) {
37+
Span<const int32_t> sizes,
38+
Span<const uint8_t> dim_order,
39+
executorch::aten::ScalarType scalar_type,
40+
const bool is_memory_planned,
41+
executorch::aten::string_view name) {
4242
return TensorInfo(
43-
Span<const int32_t>(sizes.data(), sizes.size()),
44-
Span<const uint8_t>(dim_order.data(), dim_order.size()),
45-
scalar_type,
46-
is_memory_planned,
47-
name);
43+
Span<const int32_t>(sizes.data(), sizes.size()),
44+
Span<const uint8_t>(dim_order.data(), dim_order.size()),
45+
scalar_type,
46+
is_memory_planned,
47+
name);
4848
}
4949
};
5050
} // namespace testing
@@ -199,16 +199,17 @@ TEST_F(MethodMetaTest, TensorInfoSizeOverflow) {
199199
std::numeric_limits<int32_t>::max(),
200200
std::numeric_limits<int32_t>::max(),
201201
};
202-
202+
203203
// Create a minimal dim_order
204204
std::vector<uint8_t> dim_order = {0, 1, 2, 3};
205-
206-
// Create a TensorInfo with the overflow sizes and expect it to fail.
207-
ET_EXPECT_DEATH(executorch::runtime::testing::TensorInfoTestFriend::get(
208-
Span<const int32_t>(overflow_sizes.data(), overflow_sizes.size()),
209-
Span<const uint8_t>(dim_order.data(), dim_order.size()),
210-
executorch::aten::ScalarType::Float,
211-
false, // is_memory_planned
212-
executorch::aten::string_view{nullptr, 0}),"");
213205

206+
// Create a TensorInfo with the overflow sizes and expect it to fail.
207+
ET_EXPECT_DEATH(
208+
executorch::runtime::testing::TensorInfoTestFriend::get(
209+
Span<const int32_t>(overflow_sizes.data(), overflow_sizes.size()),
210+
Span<const uint8_t>(dim_order.data(), dim_order.size()),
211+
executorch::aten::ScalarType::Float,
212+
false, // is_memory_planned
213+
executorch::aten::string_view{nullptr, 0}),
214+
"");
214215
}

0 commit comments

Comments
 (0)