code: def test_none_skip():
      @skippable(stash=["none"])
      class Stash(nn.Module):
          def forward(self, input):
              yield stash("none", None)
              return input
  
      @skippable(pop=["none"])
      class Pop(nn.Module):
          def forward(self, input):
              none = yield pop("none")
              assert none is None
              return input
  
      model = nn.Sequential(Stash(), Pop())
      model = Pipe(model, [1, 1], devices=["cpu", "cpu"], chunks=5)
  
      input = torch.rand(10, requires_grad=True)
      output = model(input)
  
      def assert_grad_fn_is_not_portal(grad_fn, visited=set()):
          if grad_fn in visited or grad_fn is None:
              return
  
          assert not isinstance(grad_fn, PortalBlue._backward_cls)
          assert not isinstance(grad_fn, PortalCopy._backward_cls)
          assert not isinstance(grad_fn, PortalOrange._backward_cls)
  
          visited.add(grad_fn)
          for next_grad_fn, _ in grad_fn.next_functions:
              assert_grad_fn_is_not_portal(next_grad_fn, visited)
  
      assert_grad_fn_is_not_portal(output.grad_fn)
  
      output.sum().backward()
      assert input.grad.mean().item() == 1
  
file_path: fairscale/tests/nn/pipe/skip/test_gpipe.py
imports: import pytest
  import torch
  from torch import nn
  from fairscale.fair_dev.testing.testing import skip_if_single_gpu
  from fairscale.nn.pipe import Pipe
  from fairscale.nn.pipe.skip import pop, skippable, stash
  from fairscale.nn.pipe.skip.portal import PortalBlue, PortalCopy, PortalOrange
label_desc: Use image node_id 2 for calling a global function with example usage: test_none_skip() and returns: input, input