code: def test_unpin_automatically():
      # run a sufficient number of iterations such that the memory pool should be
      # re-used
      for j in range(10):
          t = torch.ones(10000, 10)
          assert not F.is_pinned(t)
          nd = dgl.utils.pin_memory_inplace(t)
          assert F.is_pinned(t)
          del nd
          # dgl.ndarray will unpin its data upon destruction
          assert not F.is_pinned(t)
          del t
  
file_path: dgl/tests/python/pytorch/utils/test_pin_memory.py
imports: import backend
  import dgl
  import pytest
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: test_unpin_automatically() without return types