A batcher that can operate on (already) batched data Should be used when features have a variable batch dimension, for instance the number of units controlled.
More...
|
| SubBatchAsyncBatcher (int batchSize, ag::Container model=nullptr) |
|
| ~SubBatchAsyncBatcher () |
|
std::vector< ag::Variant > | unBatch (const ag::Variant &out, bool stripOutput, double stripValue) override |
|
ag::Variant | makeBatch (const std::vector< ag::Variant > &queries, double) override |
|
void | allowPadding (bool allowPadding) |
|
torch::Tensor | makeBatchTensors (std::vector< torch::Tensor > const &tensors, double padValue) |
|
| AsyncBatcher (ag::Container model, int batchsize, int padValue=-1, bool stripOutput=true, double stripValue=-1.) |
| Construct a batcher. More...
|
|
virtual ag::Variant | batchedForward (ag::Variant state) |
| This function queues up the state for a forward. More...
|
|
virtual | ~AsyncBatcher () |
|
void | setModel (ag::Container newModel) |
| Changes the model to be used for forwarding. More...
|
|
std::unique_lock< std::shared_mutex > | lockModel () |
| Get a lock on the model. More...
|
|
virtual std::vector< ag::Variant > | unBatch (const ag::Variant &out) |
| Given an output of the model, retrieve the replies for all the element of the batch. More...
|
|
virtual ag::Variant | makeBatch (const std::vector< ag::Variant > &queries) |
| Given a vector of queries, create the batch that is going to be passed to the model. More...
|
|
virtual bool | shouldConsume () |
| This function should return true when the batch is ready to be consumed. More...
|
|
A batcher that can operate on (already) batched data Should be used when features have a variable batch dimension, for instance the number of units controlled.
More specifically, tensors with sizes [b1, ft], [b2, ft] ..., are batched into a Tensor of size [b1 + b2 + ..., ft].
On the contrary to AsyncBatcher, SubBatchAsyncBatcher expects input tensors shape to differ on the first dimension only, and will not pad input tensors, unless explicitely autorized with 'allowPadding'.