var

Contents

var#

penzai.core.shapecheck.var(name: str) DimVar[source]#

Creates a variable for an axis shape.

The resulting variable can be used in place of a single array dimension. It can also be unpacked with *var(name) to replace a sequence of array dimensions, or with **var(name) to replace a subdictionary of named array axes.

Parameters:

name – Name for the variable.

Returns:

Variable that can be matched with axes. Repeat uses of variables with the same name must have the same length. The result can be unpacked with *var(name) to stand in for multiple positional dimensions or with **var(name) to stand in for multiple named axes.