Conversation
|
Something like this might be useful, thanks for digging into the somewhat messy show code... At present I'm a little reluctant to add more functions we encourage people to overload. I wonder if it should only do the first (say) 5 parameter arrays, so that you will never get 10 lines of noise. |
|
If I were to pick one number it would be And yes, I think standardly reporting something like this is good. But if you do it, please do it in a way that is easy to overload, (even if we don't encourage people to do so)? Sometimes I care about the One option would be to support this with a more explicit call where the user passes in the array function directly, like |
I'm not sure if you'll want this, and maybe there is a better way to do what this does, but:
This PR adds two lines that, if I haven't missed anything, should make no difference to the current behavior of
Base.show. But it allows the user some customization of the model/layer display.The particular problem this solves for me is "being able to easily inspect summary stats of the model weights at the individual tensor level". With the change in this PR, I can define eg. this:
and then when I display my model in the REPL, I can see the details I wanted for each tensor in each layer, in the context of the model structure:

PR Checklist