code: def test_size_mismatch(Xs):
      for reduce in [
          reduce_first,
          reduce_last,
          reduce_max,
          reduce_mean,
          reduce_sum,
      ]:
          model = reduce()
          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)
  
          Y_bad = Y[:-1]
          with pytest.raises(ValueError):
              backprop(Y_bad)
  
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 12 for calling a global function with example usage: test_size_mismatch(Xs) without return types