code: def grad(self, inputs, output_grads):
      (gout,) = output_grads
      s = inputs[1]
      gf = rfft_op(gout, s)
      # Multiply the last dimension of the gradient by 2, they represent
      # both positive and negative frequencies, except the first
      # and last elements (for even transforms) which are unique.
      idx = (
          [slice(None)] * (gf.ndim - 2)
          + [slice(1, (s[-1] // 2) + (s[-1] % 2))]
          + [slice(None)]
      )
      gf = set_subtensor(gf[idx], gf[idx] * 2)
      return [gf, DisconnectedType()()]
  
imports: import numpy
  from pytensor.gradient import DisconnectedType
  from pytensor.graph.basic import Apply
  from pytensor.graph.op import Op
  from pytensor.tensor.basic import as_tensor_variable
  from pytensor.tensor.math import sqrt
  from pytensor.tensor.subtensor import set_subtensor
  from pytensor.tensor.type import TensorType, integer_dtypes
label_desc: Use image node_id 4 for calling the IRFFTOp obj's underlying member method code with example usage: obj.grad(inputs, output_grads) and returns: list