code: def test_deny_moving():
      a = nn.Linear(1, 1)
      b = nn.Linear(1, 1)
  
      model = nn.Sequential(a, b)
      model = Pipe(model, [1, 1], devices=["cpu", "cpu"])
  
      # Moving is denied.
      with pytest.raises(TypeError):
          model.cuda()
  
      with pytest.raises(TypeError):
          model.cpu()
  
      with pytest.raises(TypeError):
          model.to(torch.device("cuda"))
  
      with pytest.raises(TypeError):
          model.to(0)
  
      with pytest.raises(TypeError):
          model.to("cuda")
  
      with pytest.raises(TypeError):
          model.to(device=0)
  
      with pytest.raises(TypeError):
          model.to(torch.rand(1))
  
      with pytest.raises(TypeError):
          model.to(tensor=torch.rand(1))
  
      # Casting is allowed.
      model.half()
      model.to(torch.double)
      model.to(dtype=torch.float)
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import time
  import pytest
  import torch
  from torch import nn
  from fairscale.nn.pipe import Pipe
label_desc: Use image node_id 27 for calling a global function with example usage: test_deny_moving() without return types