Skip to content

Commit

Permalink
Merge pull request #501 from letian-jiang/enable_kgraph_in_python
Browse files Browse the repository at this point in the history
Enable LogLevel.GRAPH in Python API
  • Loading branch information
narendasan authored Jul 28, 2021
2 parents bd72677 + d03b476 commit b99ebb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions py/trtorch/csrc/trtorch_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ PYBIND11_MODULE(_C, m) {
.value("WARNING", core::util::logging::LogLevel::kWARNING)
.value("INFO", core::util::logging::LogLevel::kINFO)
.value("DEBUG", core::util::logging::LogLevel::kDEBUG)
.value("GRAPH", core::util::logging::LogLevel::kGRAPH)
.export_values();
}

Expand Down
3 changes: 3 additions & 0 deletions py/trtorch/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Level(Enum):
Warning = LogLevel.WARNING
Info = LogLevel.INFO
Debug = LogLevel.DEBUG
Graph = LogLevel.GRAPH

@staticmethod
def _to_internal_level(external) -> LogLevel:
Expand All @@ -26,6 +27,8 @@ def _to_internal_level(external) -> LogLevel:
return LogLevel.INFO
if external == Level.Debug:
return LogLevel.DEBUG
if external == Level.Graph:
return LogLevel.GRAPH


def get_logging_prefix() -> str:
Expand Down

0 comments on commit b99ebb2

Please sign in to comment.