code: def test_copy_returns_on_next_device():
      portal = Portal(torch.rand(1), tensor_life=1, index=0)
  
      prev_stream = default_stream(torch.device("cpu"))
      next_stream = default_stream(torch.device("cuda"))
  
      phony = torch.zeros(0, requires_grad=True)
      assert phony.device.type == "cpu"
  
      phony = portal.copy(prev_stream, next_stream, phony)
      assert phony.device.type == "cuda"
  
file_path: fairscale/tests/nn/pipe/skip/test_portal.py
imports: import pytest
  import torch
  from fairscale.nn.pipe.dependency import fork, join
  from fairscale.nn.pipe.skip.portal import Portal
  from fairscale.nn.pipe.stream import default_stream
label_desc: Use image node_id 1 for calling a global function with example usage: test_copy_returns_on_next_device() without return types