class_docstr: Wrapper around single-ownership C-API objects that handles deletion.
class_docstr_tok: ["Wrapper","around","single-ownership","C-API","objects","that","handles","deletion","."]
code: def __init__(self, name, obj, deleter):
      # '_' prefix marks _obj private, but unclear if it is required also to
      # maintain a special CPython destruction order.
      self._obj = obj
      self.name = name
      # Note: when we're destructing the global context (i.e when the process is
      # terminating) we may have already deleted other modules. By capturing the
      # DeleteGraph function here, we retain the ability to cleanly destroy the
      # graph at shutdown, which satisfies leak checkers.
      self.deleter = deleter
      self.type_name = str(type(obj))
  
imports: import contextlib
  from tensorflow.core.framework import api_def_pb2
  from tensorflow.core.framework import op_def_pb2
  from tensorflow.python.client import pywrap_tf_session
  from tensorflow.python.util import compat
  from tensorflow.python.util import tf_contextlib
label_desc: Use image node_id 1 to create a new UniquePtr object from inherited base classes: object with example: obj = UniquePtr(name, obj, deleter)