code: def test_pytorch_wrapper_custom_serde():
      import torch.nn
  
      def serialize(model):
          return default_serialize_torch_model(model)
  
      def deserialize(model, state_bytes, device):
          return default_deserialize_torch_model(
              model, state_bytes, device
          )
  
      def get_model():
          return PyTorchWrapper_v3(
              torch.nn.Linear(2, 3),
              serialize_model=serialize,
              deserialize_model=deserialize,
          )
  
      model = get_model()
      model_bytes = model.to_bytes()
      get_model().from_bytes(model_bytes)
      with make_tempdir() as path:
          model_path = path / "model"
          model.to_disk(model_path)
          new_model = get_model().from_bytes(model_bytes)
          new_model.from_disk(model_path)
  
file_path: thinc/thinc/tests/layers/test_pytorch_wrapper.py
imports: import numpy
  import pytest
  from thinc.api import SGD, ArgsKwargs, CupyOps, Linear, MPSOps, NumpyOps, PyTorchWrapper, PyTorchWrapper_v2, PyTorchWrapper_v3, Relu, chain, get_current_ops, torch2xp, use_ops, xp2torch
  from thinc.backends import context_pools
  from thinc.compat import has_cupy_gpu, has_torch, has_torch_amp, has_torch_mps_gpu
  from thinc.layers.pytorchwrapper import PyTorchWrapper_v3
  from thinc.shims.pytorch import default_deserialize_torch_model, default_serialize_torch_model
  from thinc.shims.pytorch_grad_scaler import PyTorchGradScaler
  from thinc.util import get_torch_default_device
  from ..util import check_input_converters, make_tempdir
label_desc: Use image node_id 8 for calling a global function with example usage: test_pytorch_wrapper_custom_serde() and returns: default_serialize_torch_model, default_deserialize_torch_model, PyTorchWrapper_v3