Skip to main content

Python module

hooks

PrintHook

class max.nn.hooks.PrintHook(export_path=None)

Hook that prints/saves layer tensor inputs and outputs.

This class must be initialized added before the graph is built so the print ops can be added to the graph.

Parameters:

export_path (Optional[str])

export_path

property export_path: str | None

name_layers()

name_layers(model)

Create names for all layers in the model based on nested attributes.

Parameters:

model (Layer)

Return type:

None

print_value()

print_value(name, value)

Prints a value, and returns whether the print is successful.

Parameters:

Return type:

bool

remove()

remove()

Return type:

None

Was this page helpful?