code: def test_checkpoint_eval(setup_rpc):
      model = nn.Sequential(nn.Linear(1, 1))
      model = Pipe(model, chunks=2)
      input = torch.rand(2, 1)
  
      def find_grad_fn(grad_fn, name):
          if grad_fn is None:
              return False
          if grad_fn.__class__.__name__ == name:
              return True
          for next_grad_fn, _ in grad_fn.next_functions:
              if find_grad_fn(next_grad_fn, name):
                  return True
          return False
  
      model.train()
      train_output = model(input)
      assert find_grad_fn(
          train_output.local_value().grad_fn, "CheckpointBackward"
      )
      assert find_grad_fn(
          train_output.local_value().grad_fn, "RecomputeBackward"
      )
  
      model.eval()
      eval_output = model(input)
      assert not find_grad_fn(
          eval_output.local_value().grad_fn, "CheckpointBackward"
      )
      assert not find_grad_fn(
          eval_output.local_value().grad_fn, "RecomputeBackward"
      )
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import time
  import pytest
  import random
  import torch
  from torch import nn
  from torch import Tensor
  from torch.distributed.pipeline.sync import Pipe, NoChunk, WithDevice
  from torch.distributed.pipeline.sync.pipe import PipeSequential
  from torch.testing._internal.common_utils import run_tests, TEST_CUDA
  from torch.testing._internal.common_cuda import TEST_MULTIGPU
label_desc: Use image node_id 11 for calling a global function with example usage: test_checkpoint_eval(setup_rpc) and returns: False, False, True, True