code: def unpad_dims(output, input, leftdims, rightdims):
      """Reshapes the output after pad_dims.
  
      This reverts the padding by `pad_dims`.
      """
      if output.ndim == input.ndim:
          return output
  
      # restore the output to the original shape
      outshp = tensor.join(
          0, input.shape[:-rightdims], output.shape[-rightdims:]
      )
      return GpuReshape(input.ndim)(output, outshp)
  
file_path: Theano/theano/gpuarray/opt_util.py
imports: from __future__ import absolute_import, print_function, division
  from functools import wraps
  import numpy
  from theano import tensor, scalar, Constant
  from theano.gof import local_optimizer
  from theano.gof.opt import inherit_stack_trace
  from theano.tensor import DimShuffle, get_scalar_constant_value, NotScalarConstantError
  from .basic_ops import GpuFromHost, HostFromGpu, GpuAllocEmpty, GpuReshape
  from .elemwise import GpuDimShuffle, GpuElemwise
label_desc: Use image node_id 8 for calling a global function with example usage: unpad_dims(output, input, leftdims, rightdims) and returns: GpuReshape, output