Closed StefanUhlich-sony closed 3 years ago
Yes, this looks like a current bug with torchinfo. If you look at the calculate_macs
function, you will see that the calculation is not very robust, and was designed primarily for ConvNets.
As of now, I'm not sure how I would solve this issue. If you would like to try fixing this, I would appreciate a PR!
First of all, great work @TylerYep - torchinfo looks very nice :)
I have a question regarding the MAC computation for LSTM networks. Somehow it seems that the sequence length is not taken into account.
Here is the example from the
README.md
with two different sequence lengths:This gives the following output:
Both times, the
Total mult-adds (M)
is the same, although the sequence length is different. I think the problem is that torchinfo ignores theseq_length
, i.e., does not take into account for example the nn.Linear is usedseq_length
times. Is this behavior expected?