code: def test_bibn(backend_default, fargs, deltas_buffer):
      seq_len, input_size, hidden_size, batch_size = fargs
      in_shape = (input_size, seq_len)
      NervanaObject.be.bsz = batch_size
  
      hidden_size = min(10, hidden_size)
  
      # setup the bi-directional rnn
      init_glorot = GlorotUniform()
      birnn = BiBNRNN(
          hidden_size, activation=Rectlinclip(slope=0), init=init_glorot
      )
      birnn.configure(in_shape)
      birnn.prev_layer = True
  
      birnn.allocate()
      birnn.allocate_deltas(deltas_buffer)
      deltas_buffer.allocate_buffers()
      birnn.set_deltas(deltas_buffer)
  
      # test fprop
  
      # set the ff buffer
      inp_np = np.random.random(birnn.h_ff_buffer.shape)
      inp_be = birnn.be.array(inp_np)
      birnn.h_ff_buffer[:] = inp_np
  
      # compare the bn output with calling the backend bn
      xsum = birnn.be.zeros_like(birnn.xmean)
      xvar = birnn.be.zeros_like(birnn.xvar)
      gmean = birnn.be.zeros_like(birnn.gmean)
      gvar = birnn.be.zeros_like(birnn.gvar)
      gamma = birnn.be.ones(birnn.gamma.shape)
      beta = birnn.be.zeros_like(birnn.beta)
      grad_gamma = birnn.be.zeros_like(gamma)
      grad_beta = birnn.be.zeros_like(beta)
      out_ref = birnn.be.zeros_like(birnn.h_ff_buffer)
  
      xsum[:] = birnn.be.sum(birnn.h_ff_buffer, axis=1)
  
      birnn.be.compound_fprop_bn(
          birnn.h_ff_buffer,
          xsum,
          xvar,
          gmean,
          gvar,
          gamma,
          beta,
          out_ref,
          birnn.eps,
          birnn.rho,
          False,
          accumbeta=0,
          relu=False,
      )
  
      # call the bibnrnn layer fprop_bn
      out_bn = birnn._fprop_bn(birnn.h_ff_buffer, inference=False)
  
      assert allclose_with_out(
          out_bn.get(), out_ref.get(), rtol=0.0, atol=1.0e-5
      )
  
      # test bprop
      err_np = np.random.random(birnn.h_ff_buffer.shape)
      err_be = birnn.be.array(err_np)
  
      err_out_ref = birnn.be.empty_like(err_be)
      birnn.be.compound_bprop_bn(
          err_out_ref,
          grad_gamma,
          grad_beta,
          err_be,
          inp_be,
          xsum,
          xvar,
          gamma,
          birnn.eps,
      )
  
      err_out_bn = birnn._bprop_bn(err_be, out_bn)
  
      assert allclose_with_out(
          err_out_bn.get(), err_out_ref.get(), rtol=0.0, atol=2.5e-5
      )
  
file_path: neon/tests/test_birnn.py
imports: from builtins import zip
  import itertools
  import numpy
  from numpy import concatenate
  from neon import NervanaObject
  from neon.initializers.initializer import GlorotUniform
  from neon.layers.recurrent import BiRNN, Recurrent, get_steps, BiSum, BiBNRNN
  from neon.transforms import Rectlinclip
  from utils import allclose_with_out
label_desc: Use image node_id 6 for calling a global function with example usage: test_bibn(backend_default, fargs, deltas_buffer) without return types