class_docstr: Holds a list of enqueue operations for a queue, each to be run in a thread.
  
  Queues are a convenient TensorFlow mechanism to compute tensors
  asynchronously using multiple threads. For example in the canonical 'Input
  Reader' setup one set of threads generates filenames in a queue; a second set
  of threads read records from the files, processes them, and enqueues tensors
  on a second queue; a third set of threads dequeues these input records to
  construct batches and runs them through training operations.
  
  There are several delicate issues when running multiple threads that way:
  closing the queues in sequence as the input is exhausted, correctly catching
  and reporting exceptions, etc.
  
  The `QueueRunner`, combined with the `Coordinator`, helps handle these issues.
  
  @compatibility(TF2)
  QueueRunners are not compatible with eager execution. Instead, please
  use [tf.data](https://www.tensorflow.org/guide/data) to get data into your
  model.
  @end_compatibility
class_docstr_tok: ["Holds","a","list","of","enqueue","operations","for","a","queue",",","each","to","be","run","in","a","thread",".","Queues","are","a","convenient","TensorFlow","mechanism","to","compute","tensors","asynchronously","using","multiple","threads",".","For","example","in","the","canonical","'Input","Reader","'","setup","one","set","of","threads","generates","filenames","in","a","queue",";","a","second","set","of","threads","read","records","from","the","files",",","processes","them",",","and","enqueues","tensors","on","a","second","queue",";","a","third","set","of","threads","dequeues","these","input","records","to","construct","batches","and","runs","them","through","training","operations",".","There","are","several","delicate","issues","when","running","multiple","threads","that","way",":","closing","the","queues","in","sequence","as","the","input","is","exhausted",",","correctly","catching","and","reporting","exceptions",",","etc",".","The","`","QueueRunner","`",",","combined","with","the","`","Coordinator","`",",","helps","handle","these","issues",".","@","compatibility","(","TF2",")","QueueRunners","are","not","compatible","with","eager","execution",".","Instead",",","please","use","[","tf.data","]","(","https",":","\/\/www.tensorflow.org\/guide\/data",")","to","get","data","into","your","model",".","@","end_compatibility"]
docstr: Converts this `QueueRunner` to a `QueueRunnerDef` protocol buffer.
  
  Args:
    export_scope: Optional `string`. Name scope to remove.
  
  Returns:
    A `QueueRunnerDef` protocol buffer, or `None` if the `Variable` is not in
    the specified name scope.
docstr_tok: ["Converts","this","`","QueueRunner","`","to","a","`","QueueRunnerDef","`","protocol","buffer",".","Args",":","export_scope",":","Optional","`","string","`",".","Name","scope","to","remove",".","Returns",":","A","`","QueueRunnerDef","`","protocol","buffer",",","or","`","None","`","if","the","`","Variable","`","is","not","in","the","specified","name","scope","."]
code: def to_proto(self, export_scope=None):
      """Converts this `QueueRunner` to a `QueueRunnerDef` protocol buffer.
  
      Args:
        export_scope: Optional `string`. Name scope to remove.
  
      Returns:
        A `QueueRunnerDef` protocol buffer, or `None` if the `Variable` is not in
        the specified name scope.
      """
      if export_scope is None or self.queue.name.startswith(
          export_scope
      ):
          queue_runner_def = queue_runner_pb2.QueueRunnerDef()
          queue_runner_def.queue_name = ops.strip_name_scope(
              self.queue.name, export_scope
          )
          for enqueue_op in self.enqueue_ops:
              queue_runner_def.enqueue_op_name.append(
                  ops.strip_name_scope(enqueue_op.name, export_scope)
              )
          queue_runner_def.close_op_name = ops.strip_name_scope(
              self.close_op.name, export_scope
          )
          queue_runner_def.cancel_op_name = ops.strip_name_scope(
              self.cancel_op.name, export_scope
          )
          queue_runner_def.queue_closed_exception_types.extend(
              [
                  errors.error_code_from_exception_type(cls)
                  for cls in self._queue_closed_exception_types
              ]
          )
          return queue_runner_def
      else:
          return None
  
imports: import threading
  import weakref
  from tensorflow.core.protobuf import queue_runner_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 14 for calling the QueueRunner obj's underlying member method code with example usage: obj.to_proto(export_scope) and returns: queue_runner_def, None