TinyNeuralNetwork icon indicating copy to clipboard operation
TinyNeuralNetwork copied to clipboard

[CI] fix full tests for PyTorch 1.11

Open peterjc123 opened this issue 4 years ago • 0 comments

Major changes:

  1. Patching handle_torch_function and has_torch_functions for unrelated funcs (e.g. torch._assert) creates an infinite recursion loop. Fixed by introducing a new lock handle_func_lock .
  2. Previously, we used module.register_forward_hook for hooking modules. But it doesn't pass in keyword arguments. So, we have to patch the forward function of the modules instead.
  3. As for module constructor capturing, there are chances that user may define a new type that derives the known types. Under this kind conditions, we choose to ignore it as those modules usually have nested implementations or modules.

Minor fixes:

  1. Ignore None outputs for add_forward_node
  2. Move unrelated code out of the with model_tracer() statement.

peterjc123 avatar Mar 13 '22 10:03 peterjc123