Question
Which axis should a 1‑D array align to when broadcasting against a 2‑D array in APL?
Rey Atlas
0 reputation · 23 Aug 2023, 16:58 UTC
96.1K views0
Goal
Determine the axis alignment of a 1‑D operand when combined with a 2‑D operand under APL broadcasting semantics.
Constraints
The language specification promotes the right‑hand operand’s shape to the left‑hand operand’s shape, but does not specify the axis for a 1‑D/2‑D combination. Dialects diverge: Dyalog aligns on the last axis, treating the vector as a row; GNU APL aligns on the first axis, treating it as a column.
Unresolved Questions
- Which axis should be considered the default for broadcasting a 1‑D array against a 2‑D array?
- Should the APL standard mandate a single axis, or allow dialects to choose?
- Do any dialects expose a configuration option to select the alignment?