Lyken17 / pytorch-OpCounter

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

fix: remove all buffers registered besides the supported ops #199

Open six-m opened 1 year ago

six-m commented 1 year ago

The buffer named 'total_ops' and 'total_params' maybe remain inside the model after calling profile function when the submodule is not supported. And the checkpoints exported contains the buffers which affect loading.

This PR fix this.