code: def test_init():
      model = SparseLinear(3).initialize()
      keys = numpy.ones((5,), dtype="uint64")
      values = numpy.ones((5,), dtype="f")
      lengths = numpy.zeros((2,), dtype="int32")
      lengths[0] = 3
      lengths[1] = 2
      scores, backprop = model.begin_update((keys, values, lengths))
      assert scores.shape == (2, 3)
      d_feats = backprop(scores)
      assert len(d_feats) == 3
  
file_path: thinc/thinc/tests/layers/test_sparse_linear.py
imports: import math
  import numpy
  import pytest
  from thinc.api import SGD, SparseLinear, SparseLinear_v2, to_categorical
label_desc: Use image node_id 4 for calling a global function with example usage: test_init() without return types