'number of arithmetic operations in a Neural network

I have a neural network that I want to optimize. But first I need to figure out the number of trainable parameters and the number of arithmetic operations done in the neural network (multiplication, addition, ...). That is why I want to ask, if there is a script or function in python, that helps me find the number of arithmetic operations in the NN.

I would appreciate your advice and help.

Best regards, Fares



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source