code: def grad(self, inputs, output_grads):
      (gout,) = output_grads
      s = inputs[1]
      # Divide the last dimension of the output gradients by 2, they are
      # double-counted by the real-IFFT due to symmetry, except the first
      # and last elements (for even transforms) which are unique.
      idx = (
          [slice(None)] * (gout.ndim - 2)
          + [slice(1, (s[-1] // 2) + (s[-1] % 2))]
          + [slice(None)]
      )
      gout = T.set_subtensor(gout[idx], gout[idx] * 0.5)
      return [cuirfft_op(gout, s), DisconnectedType()()]
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import theano
  from theano import Op
  import theano.tensor
  from theano.gradient import DisconnectedType
  from .basic_ops import gpu_contiguous, as_gpuarray_variable, infer_context_name
  from .type import GpuArrayType
  import theano.tensor.fft
  from .opt import register_opt, op_lifter, register_opt2
label_desc: Use image node_id 4 for calling the CuRFFTOp obj's underlying member method code with example usage: obj.grad(inputs, output_grads) and returns: list