All problems
Flatten Feature Maps
Problem
Flatten a list of 2D feature maps into one vector.
Flatten each map in row-major order and concatenate the maps in their original order. An empty map list returns [].
Hint
Row-major per map, then maps in channel order.
Test cases
case 1
in: [[[[1,2],[3,4]]]]
expected: [1,2,3,4]
case 2
in: [[[[1,2]],[[3],[4]]]]
expected: [1,2,3,4]
case 3
in: [[[[]]]]
expected: []
case 4
in: [[[[0]]]]
expected: [0]
Starter codePython
def flatten_maps(maps):
# Your code here
pass4 test cases · run your code against them in the editor