there isn’t an official way to do this, but some folks have written ways of approximating it:

  
      
      GitHub
  
  
    

Lyken17/pytorch-OpCounter 615

Count the FLOPs of your PyTorch model. Contribute to Lyken17/pytorch-OpCounter development by creating an account on GitHub.


  
  
    
    
  
  



  
      
      GitHub
  
  
    

sovrasov/flops-counter.pytorch 341

Flops counter for convolutional networks in pytorch framework - sovrasov/flops-counter.pytorch


  
  
    
    
  
  



  
      
      GitHub
  
  
    

1adrianb/pytorch-estimate-flops 338

Estimate/count FLOPS for a given neural network using pytorch - 1adrianb/pytorch-estimate-flops