code: def test_deserialize_grad():
      a = np.random.rand(8, 1)
      t = torch.tensor(a, requires_grad=True, dtype=torch.float)
      t2 = deserialize(*serialize(t))
      assert t2.requires_grad
      assert np.allclose(a, t2.detach_().numpy())
  
imports: from __future__ import annotations
  import pytest
  from distributed.protocol import deserialize, serialize
label_desc: Use image node_id 4 for calling a global function with example usage: test_deserialize_grad() without return types