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 class
Bitcast
Bitcast
class max.pipelines.lib.Bitcast(pattern, src, dst)
Bases: object
Reinterprets the bytes of matching weights as another dtype.
Applies only to weights stored as src, such as block scales that
a checkpoint stores as raw uint8 bytes. The result is a view of the
same memory, so the shape and the bytes are unchanged.
-
Raises:
-
ValueError – If
patternis not a regular expression or uses look-around or a back-reference, orsrcanddstdiffer in width. -
Parameters:
dst
dst: DType
The dtype the weight’s bytes are reinterpreted as.
pattern
pattern: str
The regular expression a weight’s name must match.
src
src: DType
The dtype a weight must be stored as.