Crate caffe2_queue

source ·

Structs

  • | A thread-safe, bounded, blocking queue. | | Modelled as a circular buffer. | | Containing blobs are owned by the workspace. | | On read, we swap out the underlying data for | the blob passed in for blobs



  • Closes the Queue.
  • | Create a DBReader from a BlobsQueue |
  • | Creates the Queue. |
  • Dequeue the blobs from queue.
  • | Dequeue Tensors from the Queue. | | If the Queue is closed this might return | less elements than asked. | | If num_elements > 1 the returned elements | will be concatenated into one tensor | per component. |

  • | Enqueues Tensors into the queue. | | Number of input tensors should be equal | to the number of components passed during | creation of the queue. | | If the Queue is closed this operation | will fail. | | If enqueue_batch argument is set. We | will split the input tensors by the first | dimension to produce single queue elements. |
  • | TODO: This is a very naive implementation with | a single mutex. We can do the atomic index | + circular queue optimizations or pull | something more heavy-weight later
  • | Dequeue the blobs from queue. When the | queue is closed and empty, the output | status will be set to true which can be | used as exit criteria for execution | step. | | The 1st input is the queue and the last | output is the status. The rest are data | blobs. |
  • | Enqueue the blobs into queue. When the | queue is closed and full, the output | status will be set to true which can be | used as exit criteria for execution | step. | | The 1st input is the queue and the last | output is the status. The rest are data | blobs. |
  • | Dequeue the blobs from multiple queues. | When one of queues is closed and empty, | the output status will be set to true | which can be used as exit criteria for | execution step. | | The 1st input is the queue and the last | output is the status. The rest are data | blobs. |

Constants

Functions

Type Definitions