Closed a45s67 closed 1 year ago
Hi, good call! I have been thinking of doing the same thing. However, instead of using prod()
on the tensor sizes, I would just directly use the numel()
function of nn.parameter.Parameter
.
I have made a separate pull request with a couple other suggestions and additional tests.
Hi everyone. I found that the origin code only considers the parameters named "weight" and "bias". When we want to make some custom modules, like :
The original counting method will count 0 parameters. So I modify the code to count based on parameters() iterator. It looks good to me after using for a while.