code: def test_BiLSTM_fwd_bwd_shapes(ops, nO, nI, depth, bi, lengths):
      Xs = [numpy.ones((length, nI), dtype="f") for length in lengths]
      model = with_padded(LSTM(nO, nI, depth=depth, bi=bi)).initialize(
          X=Xs
      )
      for node in model.walk():
          node.ops = ops
      ys, backprop_ys = model(Xs, is_train=True)
      dXs = backprop_ys(ys)
      assert numpy.vstack(dXs).shape == numpy.vstack(Xs).shape
  
file_path: thinc/thinc/tests/layers/test_lstm.py
imports: import timeit
  import numpy
  import pytest
  from thinc.api import LSTM, NumpyOps, Ops, PyTorchLSTM, fix_random_seed, with_padded
  from thinc.compat import has_torch
label_desc: Use image node_id 6 for calling a global function with example usage: test_BiLSTM_fwd_bwd_shapes(ops, nO, nI, depth, bi, lengths) without return types