If I am understanding this right, you could make the hook a functools.partial
function to pass the name of the layer. This could be obtained by installing the hooks in a loop over for name, m in model.named_modules():
.
Best regards
Thomas
If I am understanding this right, you could make the hook a functools.partial
function to pass the name of the layer. This could be obtained by installing the hooks in a loop over for name, m in model.named_modules():
.
Best regards
Thomas