sovrasov / flops-counter.pytorch

Flops counter for convolutional networks in pytorch framework
MIT License
2.79k stars 308 forks source link

Does it support torch.bmm() or torch.matmul() #78

Closed kamiLight closed 2 months ago

kamiLight commented 3 years ago

One part of my model performs the matrix multiplication, i.e torch.bmm() / torch.matmul(), but results show the GMac of this part is 0.0, i want to know if this is because the GMac is too small or it is not support torch.bmm() or torch.matmul()?

sovrasov commented 3 years ago

ptflops can take into account only ops that are derived from nn.Module. Support of torch.bmm and similar operations requires complete redesign of the flops counting mechanism. I've started thinking of that but barely will do this soon.

sovrasov commented 2 months ago

Supported by both pytorch and aten backend, see https://github.com/sovrasov/flops-counter.pytorch/blob/master/ptflops/pytorch_ops.py#L443