Skip to content

Commit

Permalink
feat(//core/conversion/converters): Throw a warning if a converter is
Browse files Browse the repository at this point in the history
overridden

Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
  • Loading branch information
narendasan committed Jun 11, 2020
1 parent aa131ac commit 6cce381
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/conversion/converters/NodeConverterRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class NodeConverterRegistry {
bool RegisterConverter(torch::jit::FunctionSchema* signature, OpConverter& converter) {
LOG_DEBUG("Registering converter for " << canonical_schema_string(*signature));
auto name = signature->operator_name();
auto iter = converter_lut_.find(name);
if (iter != converter_lut_.end()) {
LOG_WARNING("Overriding already registered converter " << signature->name() << ", unexpected behavior may occur");
}
converter_lut_[name] = std::move(converter);
return true;
}
Expand Down

0 comments on commit 6cce381

Please sign in to comment.