code: def slstm_grad_grad(
      c_prev1,
      a1,
      i1,
      f1,
      c_prev2,
      a2,
      i2,
      f2,
      o,
      c,
      gc,
      gh,
      ggc_prev1,
      gga1,
      ggi1,
      ggf1,
      ggo1,
      ggc_prev2,
      gga2,
      ggi2,
      ggf2,
      ggo2,
  ):
      xp = backend.get_array_module(a1)
      sig_o = _sigmoid(o, xp)
      gsig_o = _grad_sigmoid(sig_o)
      ggsig_o = _grad_grad_sigmoid(sig_o)
      sig_i1 = _sigmoid(i1, xp)
      gsig_i1 = _grad_sigmoid(sig_i1)
      ggsig_i1 = _grad_grad_sigmoid(sig_i1)
      sig_i2 = _sigmoid(i2, xp)
      gsig_i2 = _grad_sigmoid(sig_i2)
      ggsig_i2 = _grad_grad_sigmoid(sig_i2)
      sig_f1 = _sigmoid(f1, xp)
      gsig_f1 = _grad_sigmoid(sig_f1)
      ggsig_f1 = _grad_grad_sigmoid(sig_f1)
      sig_f2 = _sigmoid(f2, xp)
      gsig_f2 = _grad_sigmoid(sig_f2)
      ggsig_f2 = _grad_grad_sigmoid(sig_f2)
      tanh_a1 = xp.tanh(a1)
      gtanh_a1 = _grad_tanh(tanh_a1)
      ggtanh_a1 = _grad_grad_tanh(tanh_a1, gtanh_a1)
      tanh_a2 = xp.tanh(a2)
      gtanh_a2 = _grad_tanh(tanh_a2)
      ggtanh_a2 = _grad_grad_tanh(tanh_a2, gtanh_a2)
      tanh_c = xp.tanh(c)
      gtanh_c = _grad_tanh(tanh_c)
      ggtanh_c = _grad_grad_tanh(tanh_c, gtanh_c)
  
      gc_bar = gh * sig_o * gtanh_c + gc
  
      gc_prev1 = ggf1 * gc_bar * gsig_f1
      gc_prev2 = ggf2 * gc_bar * gsig_f2
      ga1 = (
          gga1 * sig_i1 * ggtanh_a1 + ggi1 * gtanh_a1 * gsig_i1
      ) * gc_bar
      ga2 = (
          gga2 * sig_i2 * ggtanh_a2 + ggi2 * gtanh_a2 * gsig_i2
      ) * gc_bar
      gi1 = (
          gga1 * gtanh_a1 * gsig_i1 + ggi1 * tanh_a1 * ggsig_i1
      ) * gc_bar
      gi2 = (
          gga2 * gtanh_a2 * gsig_i2 + ggi2 * tanh_a2 * ggsig_i2
      ) * gc_bar
      gf1 = (
          ggc_prev1 * (gh * sig_o * gtanh_c + gc) * gsig_f1
          + ggf1 * gc_bar * c_prev1 * ggsig_f1
      )
      gf2 = (
          ggc_prev2 * (gh * sig_o * gtanh_c + gc) * gsig_f2
          + ggf2 * gc_bar * c_prev2 * ggsig_f2
      )
  
      ggc = (
          ggc_prev1 * sig_f1
          + gga1 * sig_i1 * gtanh_a1
          + ggi1 * tanh_a1 * gsig_i1
          + ggf1 * c_prev1 * gsig_f1
          + ggc_prev2 * sig_f2
          + gga2 * sig_i2 * gtanh_a2
          + ggi2 * tanh_a2 * gsig_i2
          + ggf2 * c_prev2 * gsig_f2
      )
  
      dgc_do = gh * gsig_o * gtanh_c
      go1 = go2 = ggc * dgc_do + (ggo1 + ggo2) * gh * tanh_c * ggsig_o
      dgc_dc = gh * sig_o * ggtanh_c
      gc_next = ggc * dgc_dc + (ggo1 + ggo2) * gh * gtanh_c * gsig_o
      ggh = ggc * sig_o * gtanh_c + (ggo1 + ggo2) * tanh_c * gsig_o
      return (
          gc_prev1,
          ga1,
          gi1,
          gf1,
          go1,
          gc_prev2,
          ga2,
          gi2,
          gf2,
          go2,
          gc_next,
          ggc,
          ggh,
      )
  
imports: import numpy
  import six
  from chainer import backend
  from chainer.backends import cuda
  from chainer.backends import intel64
  from chainer import function
  from chainer import function_node
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 7 for calling a global function with example usage: slstm_grad_grad(c_prev1, a1, i1, f1, c_prev2, a2, i2, f2, o, c, gc, gh, ggc_prev1, gga1, ggi1, ggf1, ggo1, ggc_prev2, gga2, ggi2, ggf2, ggo2) and returns: gc_prev1,  ga1,  gi1,  gf1,  go1,  gc_prev2,  ga2,  gi2,  gf2,  go2,  gc_next,  ggc,  ggh