Currently, hooks store values in module.output this causes an issue when using any model that uses .output to store an nn.Module attribute. It's a very generic name that can collide with a variety of modules. As such, I cannot run backpack-for-pytorch on huggingface bert models. It would be better if the name was something more specific, even just backpack_for_pytorch_output or even backpack_output to prevent collisions with attributes of the module.
Creates an error similar:
/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in __setattr__(self, name, value)
1982 elif modules is not None and name in modules:
1983 if value is not None:
-> 1984 raise TypeError(
1985 f"cannot assign '{torch.typename(value)}' as child module '{name}' "
1986 "(torch.nn.Module or None expected)"
TypeError: cannot assign 'torch.FloatTensor' as child module 'output' (torch.nn.Module or None expected)
Currently, hooks store values in
module.outputthis causes an issue when using any model that uses.outputto store an nn.Module attribute. It's a very generic name that can collide with a variety of modules. As such, I cannot run backpack-for-pytorch on huggingface bert models. It would be better if the name was something more specific, even justbackpack_for_pytorch_outputor evenbackpack_outputto prevent collisions with attributes of the module.Creates an error similar: