14.7. Enqueue

Enqueue as computational node.

Enqueueing is the process of taking two or more arrays and stacking them together using some meta container that encapsulates both arrays, and enqueues->dequeue in first in first out manner (FIFO).

While the queue is still being enqueued this node will return nothing. Once the queue has reached the desired length, it will return the queue as a list. This will map gradients again in FIFO manner using a dequeue.

Enqueue as a node, forward is enqueue, backward is dequeue, the exact inverse of the Dequeue node as we name it for the forward pass.

See: Comp-sci queues

class fhez.nn.operations.enqueue.Enqueue(length=None)

Stack multiple arrays together until a given shape is achieved.

backward(gradient)

Distribute gradient to respective inputs in order via yield.

Effectiveley backward is a dequeue but for gradients.

Warning

This YIELDS gradients unlike most nodes, requiring special logic by a network traverser, only getting one input but results in many outputs.

property cost

Get 0 cost for enqueueing arrays.

forward(x)

Accumulate inputs into a single queue, then return when full.

property length

Get the desired length of the final enqueue.

property queue

Get the current queue.

update()

Update nothing as enqueueing is not parameterisable.

updates()

Update nothing as enqueueing is not parameterisable.