def unpad_dims(output, input, leftdims, rightdims):
 if (output.ndim == input.ndim):
  return output
 outshp = tensor.join(0, input.shape[:(- rightdims)], output.shape[(- rightdims):])
 return GpuReshape(input.ndim)(output, outshp)

def unpad_dims ( output , input , leftdims , rightdims ) : if ( output . ndim == input . ndim ) : return output outshp = tensor . join ( 0 , input . shape [ : ( - rightdims ) ] , output . shape [ ( - rightdims ) : ] ) return GpuReshape ( input . ndim ) ( output , outshp )
reshapes the output after pad_dims .