TinyNeuralNetwork
TinyNeuralNetwork copied to clipboard
[CI] fix full tests for PyTorch 1.11
Major changes:
- Patching
handle_torch_functionandhas_torch_functionsfor unrelated funcs (e.g.torch._assert) creates an infinite recursion loop. Fixed by introducing a new lockhandle_func_lock. - Previously, we used
module.register_forward_hookfor hooking modules. But it doesn't pass in keyword arguments. So, we have to patch theforwardfunction of the modules instead. - 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:
- Ignore
Noneoutputs foradd_forward_node - Move unrelated code out of the
with model_tracer()statement.