I\'m using np.pad to pad 4d array
a = np.zeros((2,2,2,2)) a = a+7 apad = np.pad(a,((0,0),(0,0),(1,1),(1,1)),\'constant\')
It pads each 2d