<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/experimental/auto_batching/stackless.py#L244-L278) |

A priority queue of resumption points.

#### View aliases


**Main aliases**

[`tfp.experimental.auto_batching.frontend.st.ExecutionQueue`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/stackless/ExecutionQueue)

<br />

    tfp.experimental.auto_batching.stackless.ExecutionQueue(
        backend
    )

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.

## Methods

### `dequeue`

[View source](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/experimental/auto_batching/stackless.py#L271-L278)

    dequeue()

### `enqueue`

[View source](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/experimental/auto_batching/stackless.py#L266-L269)

    enqueue(
        program_counter, mask
    )