For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
PrintHook
PrintHook
class max.nn.hooks.PrintHook(export_path=None, filter=None)
Bases: BasePrintHook
Hook that prints layer tensor inputs and outputs.
Initialize the class before building the graph. This way, the hook can add print ops to the graph.
-
Parameters:
export_path
name_layers()
name_layers(model)
Create names for all layers in the model based on nested attributes.
name_layers_v3()
name_layers_v3(model)
Name all v3 Module layers and wrap their forward to fire the hook.
print_value()
print_value(name, value)
Prints a value, and returns whether the print is successful.
remove()
remove()
-
Return type:
-
None