TorchLean API

NN.Tensor.Internal.Syntax.Parser.Pack

Pack-pattern parsing #

This module parses the fixed axes surrounding a unique packed * axis and proves canonical rendering round trips. Fixed axes must be distinct names; numeric axes, underscores, groups, and ellipses are not part of this grammar. The parser does not check tensor shapes or unpacked component sizes.

Parse the fixed axes before and after the unique packed * axis.

Instances For

    Parse the separate pack and unpack pattern grammar.

    Instances For

      Parsing a successful pack or unpack pattern's canonical rendering succeeds with the same ordered fixed axes and packed-segment boundary.

      The reparsed pattern has fresh source spans. Comparing renderings intentionally ignores those diagnostic locations while preserving every syntactic choice used by pack and unpack checking.