code: def test_pytorch_script(nN, nI, nO):
      model = PyTorchWrapper_v2(torch.nn.Linear(nI, nO)).initialize()
      script_model = pytorch_to_torchscript_wrapper(model)
  
      X = numpy.random.randn(nN, nI).astype("f")
      Y = model.predict(X)
      Y_script = script_model.predict(X)
      numpy.testing.assert_allclose(Y, Y_script)
  
      serialized = script_model.to_bytes()
      script_model2 = TorchScriptWrapper_v1()
      script_model2.from_bytes(serialized)
  
      numpy.testing.assert_allclose(Y, script_model2.predict(X))
  
imports: import numpy
  import pytest
  from thinc.api import PyTorchWrapper_v2, TorchScriptWrapper_v1, pytorch_to_torchscript_wrapper
  from thinc.compat import has_torch, torch
label_desc: Use image node_id 1 for calling a global function with example usage: test_pytorch_script(nN, nI, nO) without return types