Skip to content

Enable LogLevel.GRAPH in Python API #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add an exception or something here if the program gets this far into the cases.



def get_logging_prefix() -> str:
Expand Down