Skip to content
DeepForgeby svx
All problems

Frame Stack Shape

Problem

Return the shape of a stack of k frames stacked along the channel axis.

Given the height, width, and channels of one frame, return [height, width, channels * k].

Hint

Stacking frames as extra channels is the usual Atari input representation.

Test cases

case 1
in: [84,84,1,4]
expected: [84,84,4]
case 2
in: [32,32,3,2]
expected: [32,32,6]
case 3
in: [10,20,4,1]
expected: [10,20,4]
Starter codePython
def frame_stack_shape(height, width, channels, k):
    # Your code here
    pass

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