Lyken17 / pytorch-OpCounter

Count the MACs / FLOPs of your PyTorch model.
MIT License
4.85k stars 528 forks source link

kwargs instead of args #164

Open naviak opened 2 years ago

naviak commented 2 years ago

Usage of kwargs seems to be better than the current usage of args..

Lyken17 commented 2 years ago

This will change the default behavior of thop. Could you list some examples that requires kwargs for the net input?

naviak commented 2 years ago

Hi, for example it could be much easier to use thop working with transformers. Here u may see the forward function of BART model. So user may pass not all parameters, e.g. input_ids, attention_mask and past_key_values. image