Lyken17 / pytorch-OpCounter

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

How to exclude flops of 1st input? #211

Open Angiemaster opened 1 year ago

Angiemaster commented 1 year ago

I wanna exclude the t=1 for the total_ops & total_params, just need t=2~5, could you help me with it? thank you total_ops += m.total_ops total_params += m.total_params

My input is below, t = 5 A= torch.rand(1, t, 3, LR_h, LR_w).cuda() B= torch.rand(1, t, 3, FV_h, FV_w).cuda() macs, params = profile_origin(model, inputs=(A,B))

ivanstepanovftw commented 10 months ago

Ask here: chat.openai.com