ttnn.register_pre_operation_hook

ttnn.register_pre_operation_hook(hook)

register_pre_operation_hook is a context manager that registers a pre-operation hook. The hook can be used to run custom code before the operation is executed.

Parameters:
  • operation – The operation that is being called.

  • args – The arguments that are passed to the operation.

  • kwargs – The keyword arguments that are passed to the operation.

Returns:

None – the hook is executed.