For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
bind_decoder_scratch
bind_decoder_scratch()
max.pipelines.lib.module_registration.bind_decoder_scratch(decoder_cls, model_config, batch_processor, *, max_batch_size, devices)
Allocates a registered decoder’s workspace and gives it to the batcher.
-
Parameters:
-
- decoder_cls (type[Any]) – The registered
DECODERclass. - model_config (Any) – The finalized config the decoder is built from.
- batch_processor (object) – The pipeline model’s batch processor.
- max_batch_size (int) – The most requests a step holds.
- devices (Sequence[Device]) – The devices the decoder runs on.
- decoder_cls (type[Any]) – The registered
-
Returns:
-
The workspace, or
Nonewhen the decoder declares none. -
Raises:
-
TypeError – If the decoder declares workspace and the batch processor isn’t a
DecoderBatchProcessor, which passes it. -
Return type:
-
DecoderScratch | None