tfp.experimental.auto_batching.stackless.ExecutionQueue

View source on GitHub

Class ExecutionQueue

A priority queue of resumption points.

Aliases:

Each resumption point is a pair of program counter to resume, and mask of threads that are waiting there.

This class is a simple wrapper around Python's standard heapq implementation of priority queues. There are just two subtleties:

  • Dequeue gets all the threads that were waiting at that point, by coalescing multiple entries if needed.

  • Enqueue drops entries with empty masks, because they need never be resumed.

__init__

View source

__init__(backend)

Initialize self. See help(type(self)) for accurate signature.

Methods

dequeue

View source

dequeue()

enqueue

View source

enqueue(
    program_counter,
    mask
)