code: def create_task_without_skip_trackers(
      checkpoint_stop: int,
      i: int,
      j: int,
      batch: Batch,
      partition: nn.Sequential,
  ) -> Task:
      # Determine whether checkpointing or not.
      if i < checkpoint_stop:
  
          def function(
              input: TensorOrTensors,
              partition: nn.Sequential = partition,
              chunk_id: int = i,
              part_id: int = j,
          ) -> TensorOrTensors:
              with record_function(
                  "chunk%d-part%d" % (chunk_id, part_id)
              ):
                  return partition(input)
  
          chk = Checkpointing(function, batch)
          task = Task(
              None, compute=chk.checkpoint, finalize=chk.recompute
          )
          del function, chk
  
      else:
  
          def compute(
              batch: Batch = batch,
              partition: nn.Sequential = partition,
              chunk_id: int = i,
              part_id: int = j,
          ) -> Batch:
              with record_function(
                  "chunk%d-part%d" % (chunk_id, part_id)
              ):
                  return batch.call(partition)
  
          task = Task(None, compute=compute, finalize=None)
          del compute
  
      return task
  
imports: import time
  from typing import Any, Dict, List, Tuple, Union
  import torch
  from torch import nn
  from torch.autograd.profiler import record_function
  from torch.distributed import ProcessGroup
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader
  from fairscale.nn.model_parallel import get_pipeline_parallel_ranks
  from fairscale.nn.pipe.async_schedule import AsyncMessageBody, AsyncMessageType, AsyncRecvOperator, Location, ModuleWrapper
  from fairscale.nn.pipe.checkpoint import Checkpointing
  from fairscale.nn.pipe.messages import Transport
  from fairscale.nn.pipe.microbatch import Batch
  from fairscale.nn.pipe.types import EVENT_LOOP_ACTIVATIONS_QUEUE, EVENT_LOOP_GRADIENTS_QUEUE, PipeMessage, TensorOrTensors
  from fairscale.nn.pipe.worker import Task
label_desc: Use image node_id 1 for calling a global function with example usage: create_task_without_skip_trackers(checkpoint_stop, i, j, batch, partition) and returns: task, partition, batch