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

build_decoder_scratch

build_decoder_scratch()​

max.pipelines.lib.decoder_scratch.build_decoder_scratch(decoder_cls, config, *, max_batch_size, devices)

source

Allocates the workspace a registered decoder declares, if any.

Parameters:

  • decoder_cls (type[Any]) – The registered DECODER class.
  • config (Any) – The finalized config the decoder is built from.
  • max_batch_size (int) – The most requests a step holds.
  • devices (Sequence[Device]) – The devices the decoder runs on.

Raises:

  • TypeError – If scratch_types returns something other than buffer types.
  • ValueError – If a buffer’s shape isn’t static.

Return type:

DecoderScratch | None