code: def backward(self, indexes, grad_outputs):
      x, beta, gy = self.get_retained_inputs()
      beta = chainer.functions.broadcast_to(
          beta.reshape(self.extended_shape), gy.shape
      )
      ggx, ggb = grad_outputs
      ggb = chainer.functions.broadcast_to(
          ggb.reshape(self.extended_shape), gy.shape
      )
  
      sig = chainer.functions.sigmoid(beta * x)
      y = x * sig
      by = beta * y
      one_minus_sig = 1 - sig
      sig_one_minus_by = sig * (1 - by)
      y_x_minus_y = y * (x - y)
      x_minus_2y = x - 2 * y
  
      ret = []
  
      common = gy * y * (2 + beta * x_minus_2y) * one_minus_sig
      if 0 in indexes:
          gx = (
              ggx
              * gy
              * beta
              * one_minus_sig
              * (by + 2 * sig_one_minus_by)
              + ggb * common
          )
          ret.append(chainer.functions.cast(gx, x.dtype))
      if 1 in indexes:
          gb = ggx * common + ggb * gy * y_x_minus_y * x_minus_2y
          gb = chainer.functions.sum(gb, axis=self.reduction_axes)
          ret.append(chainer.functions.cast(gb, beta.dtype))
      if 2 in indexes:
          ggy = ggx * (by + sig_one_minus_by) + ggb * y_x_minus_y
          ret.append(chainer.functions.cast(ggy, gy.dtype))
  
      return ret
  
imports: import numpy
  import chainer
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 4 for calling the SwishGrad obj's underlying member method code with example usage: obj.backward(indexes, grad_outputs) and returns: ret