Skip to content

Commit

Permalink
refactor: naming cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
  • Loading branch information
narendasan committed Jul 15, 2020
1 parent 6cee04d commit 0e3a684
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/conversion/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cc_library(
],
srcs = [
"conversion.cpp",
"conversion_blacklist.cpp",
"conversion_ignorelist.cpp",
"InterfaceTypes.cpp"
],
deps = [
Expand Down
12 changes: 6 additions & 6 deletions core/conversion/conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace trtorch {
namespace core {
namespace conversion {

// Defined in core/conversion/conversion_blacklist.cpp
bool isNodeConversionBlacklisted(const torch::jit::Node* n);
// Defined in core/conversion/conversion_ignorelist.cpp
bool isNodeConversionIgnored(const torch::jit::Node* n);

bool OpSupported(const torch::jit::Node* n) {
return evaluators::shouldEvalAtConversionTime(n) || converters::node_is_convertable(n);
Expand Down Expand Up @@ -302,7 +302,7 @@ void ConvertBlockToNetDef(ConversionCtx* ctx, const torch::jit::Block* b, Conver

for (const auto n : nodes) {
bool to_eval = evaluators::shouldEvalAtConversionTime(n);
bool blacklisted = isNodeConversionBlacklisted(n);
bool ignored = isNodeConversionIgnored(n);
if (n->kind() == torch::jit::prim::Loop) {
EvaluateLoopBlock(ctx, n);
} else if (n->kind() == torch::jit::prim::If) {
Expand All @@ -317,16 +317,16 @@ void ConvertBlockToNetDef(ConversionCtx* ctx, const torch::jit::Block* b, Conver
}
ctx->AssociateValueAndIValue(n->output(0), eval.value());
}
} else if (!blacklisted) {
} else if (!ignored) {
// Should error out if something fails
AddLayer(ctx, n);
} else {
std::string reason = "";
if (to_eval) {
reason += " (to be evaluated)";
}
if (blacklisted) {
reason += " (explicitly blacklisted)";
if (ignored) {
reason += " (explicitly ignored)";
}
LOG_DEBUG(ctx->logger,
"Skipping Node: " << util::node_info(n) << reason);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const std::unordered_set<std::string>& get_non_convertable_nodes() {
return nonconvertable_nodes;
}

bool isNodeConversionBlacklisted(const torch::jit::Node* n) {
bool isNodeConversionIgnored(const torch::jit::Node* n) {
auto kind = n->kind();
auto convertableIt = get_non_convertable_nodes().find(kind.toQualString());
if (convertableIt == get_non_convertable_nodes().end()) {
Expand Down

0 comments on commit 0e3a684

Please sign in to comment.