class_docstr: Controls saving and loading of workspaces on every epoch boundary of a job.
  If a CheckpointManager instance is passed to JobRunner, then JobRunner will
  call `init`, `read` and `save` at different moments in between epoch runs.
  
  Args:
      db_prefix: The prefix used to construct full db name. Since `absolute_path`
          is set to True, this will be used as db_name in SaveOp.
      node_name: Name of the node where this checkpoint_manager is used.
      db_type: Type of database to use for storing checkpoint.
      metadata_handler: An optional object capable of reading/writing
          checkpoint info in storage of choice.
class_docstr_tok: ["Controls","saving","and","loading","of","workspaces","on","every","epoch","boundary","of","a","job",".","If","a","CheckpointManager","instance","is","passed","to","JobRunner",",","then","JobRunner","will","call","`","init","`",",","`","read","`","and","`","save","`","at","different","moments","in","between","epoch","runs",".","Args",":","db_prefix",":","The","prefix","used","to","construct","full","db","name",".","Since","`","absolute_path","`","is","set","to","True",",","this","will","be","used","as","db_name","in","SaveOp",".","node_name",":","Name","of","the","node","where","this","checkpoint_manager","is","used",".","db_type",":","Type","of","database","to","use","for","storing","checkpoint",".","metadata_handler",":","An","optional","object","capable","of","reading\/writing","checkpoint","info","in","storage","of","choice","."]
docstr: Build a Task that will be run once after the job's `init_group` is run.
  This task will determine which blobs need to be checkpointed.
  If retrieve_from_epoch is not None, then the checkpoint metadata is
  retrieved from a previously saved checkpoint.
docstr_tok: ["Build","a","Task","that","will","be","run","once","after","the","job","'s","`","init_group","`","is","run",".","This","task","will","determine","which","blobs","need","to","be","checkpointed",".","If","retrieve_from_epoch","is","not","None",",","then","the","checkpoint","metadata","is","retrieved","from","a","previously","saved","checkpoint","."]
code: def init(
      self,
      nodes=None,
      retrieve_from_epoch=None,
      path_prefix=None,
      path_type=None,
  ):
      """
      Build a Task that will be run once after the job's `init_group` is run.
      This task will determine which blobs need to be checkpointed.
      If retrieve_from_epoch is not None, then the checkpoint metadata is
      retrieved from a previously saved checkpoint.
      """
      assert (
          nodes is None or len(nodes) == 1
      ), "CheckpointManager only supports single node."
  
      with Task(outputs=[self._blob_names]) as task:
          if retrieve_from_epoch is None:
              ops.GetAllBlobNames(
                  [], self._blob_names, include_shared=False
              )
          else:
              full_db_name = db_name(
                  retrieve_from_epoch,
                  self._node_name,
                  self._db_prefix,
                  path_prefix,
              )
              db_type = path_type or self._db_type
              logger.info(
                  "Initializing checkpoints from = %s" % full_db_name
              )
              ops.Load(
                  [],
                  self._blob_names,
                  db=full_db_name,
                  db_type=db_type,
                  absolute_path=True,
                  keep_device=True,
              )
      self._names_output = task.outputs()[0]
      return task
  
imports: import os
  import logging
  from caffe2.python import core, context
  from caffe2.python.net_builder import ops
  from caffe2.python.task import final_output, Node, Task, TaskGroup, TaskOutput, WorkspaceType
label_desc: Use image node_id 2 for calling the CheckpointManager obj's underlying member method code with example usage: obj.init(nodes, retrieve_from_epoch, path_prefix, path_type) and returns: task