code: def test_chain(ops):
      data = numpy.asarray([[1, 2, 3, 4]], dtype="f")
      model = chain(Linear(1), Dropout(), Linear(1))
      model.ops = ops
      model.initialize(data, data)
      Y, backprop = model(data, is_train=True)
      backprop(Y)
      # Layers with and without nO/nI
      model = chain(Linear(1), Dropout(), Linear(1, 1))
      model.initialize(data, data)
      # Setting dim on model
      model = chain(Linear(1), Dropout(), Linear(1))
      model.set_dim("nO", 1)
      model.initialize(data, None)
      model = chain(Linear(1, 1), Dropout(), Linear(1, 1))
      model.set_dim("nI", 1)
      model.initialize(None, data)
      # Not enough arguments
      with pytest.raises(TypeError):
          chain(Linear())
      with pytest.raises(TypeError):
          chain()
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from thinc.api import Dropout, Linear, Model, NumpyOps, add, clone, concatenate, map_list, noop
  from thinc.layers import chain, tuplify
label_desc: Use image node_id 23 for calling a global function with example usage: test_chain(ops) without return types