code: def test_gradient():
      truth = numpy.zeros((nB, nO), dtype="float32")
      truth[0] = 1.0
  
      guess, backprop = model.begin_update(input_data)
      backprop(guess - truth)
  
      for layer in model.layers:
          for name in layer.param_names:
              agrad = layer.get_grad(
                  name
              ).ravel()  # Should have grads for all params.
              predict = get_predict(layer, name, input_data)
              ngrad = get_numeric_gradient(predict, agrad.size, truth)
              assert_allclose(agrad, ngrad, atol=0.2, rtol=0.2)
  
imports: from functools import partial
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from thinc.api import Linear, NumpyOps, Relu, chain
label_desc: Use image node_id 17 for calling a global function with example usage: test_gradient() without return types