Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-244

Inverted Residual Expansion

Problem

Compute the expanded channel count of an inverted residual block, rounded up to a multiple of multiple.

Return ((cin * ratio + multiple - 1) // multiple) * multiple.

Test cases

case 1
in: [24,6,8]
expected: 144
case 2
in: [32,3,8]
expected: 96
case 3
in: [16,3,8]
expected: 48
case 4
in: [30,1,8]
expected: 32
Starter codePython
def expanded_channels(cin, ratio, multiple):
    # Your code here
    pass

4 test cases · run your code against them in the editor