All problems
Conv FLOPs Count
Problem
Count the multiply-accumulate floating point operations of a 2D convolution.
Return 2 * cin * cout * k * k * h_out * w_out (bias excluded), where the factor 2 accounts for each multiply and add.
Test cases
case 1
in: [3,16,3,28,28]
expected: 677376
case 2
in: [1,1,3,5,5]
expected: 450
case 3
in: [64,128,3,14,14]
expected: 28901376
Starter codePython
def conv_flops(cin, cout, k, h_out, w_out):
# Your code here
pass3 test cases · run your code against them in the editor