def unsqueeze(data, axis, oldshape):
 newshape = list(oldshape)
 newshape[axis] = 1
 return data.reshape(newshape)

def unsqueeze ( data , axis , oldshape ) : newshape = list ( oldshape ) newshape [ axis ] = 1 return data . reshape ( newshape )
unsqueeze a collapsed array .