IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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)

source

Allocates a registered decoder’s workspace and gives it to the batcher.

Parameters:

  • decoder_cls (type[Any]) – The registered DECODER class.
  • 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.

Returns:

The workspace, or None when 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