code: def test_reduce_last(Xs):
      model = reduce_last()
      lengths = model.ops.asarray([x.shape[0] for x in Xs], dtype="i")
      X = Ragged(model.ops.flatten(Xs), lengths)
      Y, backprop = model(X, is_train=True)
      assert isinstance(Y, numpy.ndarray)
      assert Y.shape == (len(Xs), Xs[0].shape[1])
      assert Y.dtype == Xs[0].dtype
      assert list(Y[0]) == list(Xs[0][-1])
      assert list(Y[1]) == list(Xs[1][-1])
      dX = backprop(Y)
      assert dX.dataXd.shape == X.dataXd.shape
  
file_path: thinc/thinc/tests/layers/test_reduce.py
imports: import numpy
  import pytest
  from thinc.api import reduce_first, reduce_last, reduce_max, reduce_mean, reduce_sum
  from thinc.types import Ragged
label_desc: Use image node_id 8 for calling a global function with example usage: test_reduce_last(Xs) without return types