code: def make_checkpoint(
      function: Function, input: TensorOrTensors, index: int
  ) -> TensorOrTensors:
      """Makes a checkpoint with a simple interface like
      :func:`torch.utils.checkpoint.checkpoint`. It's only used to test or debug
      :class:`Checkpoint` and :class:`Recompute` without boilerplate.
      """
      batch = Batch(input, index)
  
      chk = Checkpointing(function, batch)
      batch = chk.checkpoint()
      chk.recompute(batch)
  
      return batch.tensor_or_tensors
  
file_path: fairscale/tests/nn/pipe/test_checkpoint.py
imports: from functools import partial
  import pytest
  import torch
  from torch import nn
  import torch.cuda
  from fairscale.nn.pipe.checkpoint import Checkpointing, Function, TensorOrTensors, is_checkpointing, is_recomputing
  from fairscale.nn.pipe.dependency import fork, join
  from fairscale.nn.pipe.microbatch import Batch
label_desc: Use image node_id 1 for calling a global function with example usage: make_checkpoint(function, input, index) and returns: batch