Skip to content

console

torch_to_nnef.console

Helper to display in console nicely.

Console

Console(theme: T.Optional[T.Dict[str, str]])

Inspired by rich.console without the deps on rich.

Only support linux/Mac TTY

Initialize the Console with an optional theme.

This constructor sets up the underlying printer. If the rich library is available, it will be used; otherwise a simple fallback printing routine is installed.

Parameters:

Name Type Description Default
theme Optional[Dict[str, str]]

Optional mapping of color names to ANSI codes for custom styling. If None the default rich theme is used.

required