Skip to content

Commit 605b549

Browse files
committed
refactor(elementwise): Apply linting for new elementwise ops
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 410ee2a commit 605b549

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

core/conversion/converters/impl/element_wise.cpp

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,16 @@ auto element_wise_registrations TRTORCH_UNUSED =
448448
auto self = args[0].ITensorOrFreeze(ctx);
449449
auto other = args[1].ITensorOrFreeze(ctx);
450450

451-
auto greater =
452-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kGREATER, self, other, util::node_info(n)+"_greater");
451+
auto greater = add_elementwise(
452+
ctx, nvinfer1::ElementWiseOperation::kGREATER, self, other, util::node_info(n) + "_greater");
453453
TRTORCH_CHECK(greater, "Unable to create Greater layer from node: " << *n);
454454

455-
auto equal =
456-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n)+"_equal");
455+
auto equal = add_elementwise(
456+
ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n) + "_equal");
457457
TRTORCH_CHECK(equal, "Unable to create Equal layer from node: " << *n);
458458

459-
auto or_op = ctx->net->addElementWise(*greater->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
459+
auto or_op = ctx->net->addElementWise(
460+
*greater->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
460461

461462
TRTORCH_CHECK(or_op, "Unable to create Or layer from node: " << *n);
462463
or_op->setName(util::node_info(n).c_str());
@@ -472,15 +473,16 @@ auto element_wise_registrations TRTORCH_UNUSED =
472473
auto otherScalar = args[1].unwrapToScalar().to<float>();
473474
auto other = tensor_to_const(ctx, torch::tensor({otherScalar}));
474475

475-
auto greater =
476-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kGREATER, self, other, util::node_info(n)+"_greater");
476+
auto greater = add_elementwise(
477+
ctx, nvinfer1::ElementWiseOperation::kGREATER, self, other, util::node_info(n) + "_greater");
477478
TRTORCH_CHECK(greater, "Unable to create Greater layer from node: " << *n);
478479

479-
auto equal =
480-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n)+"_equal");
480+
auto equal = add_elementwise(
481+
ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n) + "_equal");
481482
TRTORCH_CHECK(equal, "Unable to create Equal layer from node: " << *n);
482483

483-
auto or_op = ctx->net->addElementWise(*greater->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
484+
auto or_op = ctx->net->addElementWise(
485+
*greater->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
484486

485487
TRTORCH_CHECK(or_op, "Unable to create Or layer from node: " << *n);
486488
or_op->setName(util::node_info(n).c_str());
@@ -495,15 +497,16 @@ auto element_wise_registrations TRTORCH_UNUSED =
495497
auto self = args[0].ITensorOrFreeze(ctx);
496498
auto other = args[1].ITensorOrFreeze(ctx);
497499

498-
auto less =
499-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kLESS, self, other, util::node_info(n)+"_less");
500+
auto less = add_elementwise(
501+
ctx, nvinfer1::ElementWiseOperation::kLESS, self, other, util::node_info(n) + "_less");
500502
TRTORCH_CHECK(less, "Unable to create Less layer from node: " << *n);
501503

502-
auto equal =
503-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n)+"_equal");
504+
auto equal = add_elementwise(
505+
ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n) + "_equal");
504506
TRTORCH_CHECK(equal, "Unable to create Equal layer from node: " << *n);
505507

506-
auto or_op = ctx->net->addElementWise(*less->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
508+
auto or_op = ctx->net->addElementWise(
509+
*less->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
507510

508511
TRTORCH_CHECK(or_op, "Unable to create Or layer from node: " << *n);
509512
or_op->setName(util::node_info(n).c_str());
@@ -519,15 +522,16 @@ auto element_wise_registrations TRTORCH_UNUSED =
519522
auto otherScalar = args[1].unwrapToScalar().to<float>();
520523
auto other = tensor_to_const(ctx, torch::tensor({otherScalar}));
521524

522-
auto less =
523-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kLESS, self, other, util::node_info(n)+"_less");
525+
auto less = add_elementwise(
526+
ctx, nvinfer1::ElementWiseOperation::kLESS, self, other, util::node_info(n) + "_less");
524527
TRTORCH_CHECK(less, "Unable to create Less layer from node: " << *n);
525528

526-
auto equal =
527-
add_elementwise(ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n)+"_equal");
529+
auto equal = add_elementwise(
530+
ctx, nvinfer1::ElementWiseOperation::kEQUAL, self, other, util::node_info(n) + "_equal");
528531
TRTORCH_CHECK(equal, "Unable to create Equal layer from node: " << *n);
529532

530-
auto or_op = ctx->net->addElementWise(*less->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
533+
auto or_op = ctx->net->addElementWise(
534+
*less->getOutput(0), *equal->getOutput(0), nvinfer1::ElementWiseOperation::kOR);
531535

532536
TRTORCH_CHECK(or_op, "Unable to create Or layer from node: " << *n);
533537
or_op->setName(util::node_info(n).c_str());

0 commit comments

Comments
 (0)