Skip to content

Commit 3744847

Browse files
committed
refactor(aten::zeros): Apply linting
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 0f95565 commit 3744847

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

core/conversion/conversion.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ std::set<std::string> GetUnsupportedOpsInBlock(const torch::jit::Block* b) {
436436
std::set<std::string> ConvertableOpsInBlock(const torch::jit::Block* b) {
437437
std::set<std::string> convertable_ops;
438438
for (const auto n : b->nodes()) {
439-
if (n->kind() == torch::jit::prim::Loop || n->kind() == torch::jit::prim::If || converters::node_is_convertable(n)) {
439+
if (n->kind() == torch::jit::prim::Loop || n->kind() == torch::jit::prim::If ||
440+
converters::node_is_convertable(n)) {
440441
if (n->blocks().size() > 0) {
441442
for (const auto sub_b : n->blocks()) {
442443
auto sub_b_convertable_ops = ConvertableOpsInBlock(sub_b);
@@ -446,8 +447,7 @@ std::set<std::string> ConvertableOpsInBlock(const torch::jit::Block* b) {
446447
if (converters::node_is_convertable(n)) {
447448
auto schema = n->maybeSchema();
448449
TRTORCH_CHECK(
449-
schema,
450-
"Unable to get schema for Node " << util::node_info(n) << " (conversion.CheckForConvertableOps)");
450+
schema, "Unable to get schema for Node " << util::node_info(n) << " (conversion.CheckForConvertableOps)");
451451
std::stringstream ss;
452452
ss << *schema;
453453
convertable_ops.insert(ss.str());
@@ -476,10 +476,12 @@ bool VerifyConverterSupportForBlock(const torch::jit::Block* b) {
476476

477477
if (ConvertableOpsInBlock(b).size() == 0) {
478478
std::stringstream unsupported_msg;
479-
unsupported_msg << "Method requested cannot be compiled by TRTorch.\nThere is no work to be done since the resulting compiled program will contain an engine that is empty."
480-
<< std::endl;
481-
unsupported_msg << "This may be because there are no operators that can be added to the TensorRT graph or all operators have a resolved compile time value."
482-
<< std::endl;
479+
unsupported_msg
480+
<< "Method requested cannot be compiled by TRTorch.\nThere is no work to be done since the resulting compiled program will contain an engine that is empty."
481+
<< std::endl;
482+
unsupported_msg
483+
<< "This may be because there are no operators that can be added to the TensorRT graph or all operators have a resolved compile time value."
484+
<< std::endl;
483485
LOG_ERROR(unsupported_msg.str());
484486
return false;
485487
}

core/conversion/evaluators/aten.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ auto aten_registrations TRTORCH_UNUSED =
118118
// aten::zeros(int[] size, *, int? dtype=None, int? layout=None,
119119
// Device? device=None, bool? pin_memory=None) -> (Tensor)
120120
[](const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> {
121-
auto options = torch::TensorOptions()
122-
.layout(torch::kStrided)
123-
.device(torch::kCUDA);
121+
auto options = torch::TensorOptions().layout(torch::kStrided).device(torch::kCUDA);
124122

125123
if (!args.at(n->input(1)).isNone() && !args.at(n->input(1)).IValue()->isNone()) {
126124
options = options.dtype(c10::ScalarType(args.at(n->input(1)).unwrapToInt()));

0 commit comments

Comments
 (0)