Skip to content

Commit

Permalink
Enable LogLevel.GRAPH in Python API
Browse files Browse the repository at this point in the history
Signed-off-by: Letian Jiang <[email protected]>
  • Loading branch information
letian-jiang committed Jun 17, 2021
1 parent eb39f9c commit d03b476
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 @@ -309,6 +309,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 d03b476

Please sign in to comment.