Skip to content

Commit 9bdb5c8

Browse files
committed
refactor(elementwise): Lint new elementwise operators
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent a35fbf1 commit 9bdb5c8

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

core/conversion/converters/impl/element_wise.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ auto element_wise_registrations TRTORCH_UNUSED =
213213
auto unuse = Weights();
214214
// IScaleLayer assert shift, scale and power to have
215215
// the same dtype
216-
auto scaleLayer = ctx->net->addScale(
217-
*self, nvinfer1::ScaleMode::kUNIFORM, unuse.data, scaleW.data, unuse.data);
216+
auto scaleLayer =
217+
ctx->net->addScale(*self, nvinfer1::ScaleMode::kUNIFORM, unuse.data, scaleW.data, unuse.data);
218218
TRTORCH_CHECK(scaleLayer, "Unable to create scale layer from node: " << *n);
219219
self = scaleLayer->getOutput(0);
220220
}
@@ -240,8 +240,8 @@ auto element_wise_registrations TRTORCH_UNUSED =
240240
auto unuse = Weights();
241241
// IScaleLayer assert shift, scale and power to have
242242
// the same dtype
243-
auto scaleLayer = ctx->net->addScale(
244-
*self, nvinfer1::ScaleMode::kUNIFORM, unuse.data, scaleW.data, unuse.data);
243+
auto scaleLayer =
244+
ctx->net->addScale(*self, nvinfer1::ScaleMode::kUNIFORM, unuse.data, scaleW.data, unuse.data);
245245
TRTORCH_CHECK(scaleLayer, "Unable to create scale layer from node: " << *n);
246246
self = scaleLayer->getOutput(0);
247247
}
@@ -415,8 +415,8 @@ auto element_wise_registrations TRTORCH_UNUSED =
415415
// TODO: Remove with functionalization
416416
auto self = args[0].ITensorOrFreeze(ctx);
417417
auto other = args[1].ITensorOrFreeze(ctx);
418-
auto floor_divide =
419-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kFLOOR_DIV, self, other, util::node_info(n));
418+
auto floor_divide = add_elementwise(
419+
ctx, nvinfer1::ElementWiseOperation::kFLOOR_DIV, self, other, util::node_info(n));
420420
TRTORCH_CHECK(floor_divide, "Unable to create floor_divide layer from node: " << *n);
421421

422422
floor_divide->setName(util::node_info(n).c_str());
@@ -430,8 +430,8 @@ auto element_wise_registrations TRTORCH_UNUSED =
430430
auto self = args[0].ITensorOrFreeze(ctx);
431431
auto otherScalar = args[1].unwrapToScalar().to<float>();
432432
auto other = tensor_to_const(ctx, torch::tensor({otherScalar}));
433-
auto floor_divide =
434-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kFLOOR_DIV, self, other, util::node_info(n));
433+
auto floor_divide = add_elementwise(
434+
ctx, nvinfer1::ElementWiseOperation::kFLOOR_DIV, self, other, util::node_info(n));
435435
TRTORCH_CHECK(floor_divide, "Unable to create floor_divide layer from node: " << *n);
436436

437437
floor_divide->setName(util::node_info(n).c_str());

tests/core/conversion/converters/test_element_wise.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ TEST(Converters, ATenNeScalarConvertsCorrectly) {
164164
pointwise_test_helper(graph, true);
165165
}
166166

167-
168167
TEST(Converters, ATenFloorDivideConvertsCorrectly) {
169168
const auto graph = R"IR(
170169
graph(%0 : Tensor, %1 : Tensor):
@@ -177,7 +176,6 @@ TEST(Converters, ATenFloorDivideConvertsCorrectly) {
177176
pointwise_test_helper(graph, false, true, {4, 3}, {3, 4, 3});
178177
}
179178

180-
181179
TEST(Converters, ATenFloorDivideWithScalarConvertsCorrectly) {
182180
const auto graph = R"IR(
183181
graph(%0 : Tensor):

0 commit comments

Comments
 (0)