Understand how `shape` and input shapes interact
mainThe shape parameter must be broadcastable from your input extrinsic shapes. The following rules apply:
- Alignment: Input shapes must align from the right with
shape. - Expansion: Input shapes with size-1 dimensions can expand to match
shape. - Randomization Axes: Axes in
shapethat exceed the input dimensions enumerate additional independent randomizations.
| Input extrinsic | shape | Result |
|---|---|---|
(10,) | (10,) | 10 configurations, 1 randomization each |
(10,) | (5, 10) | 10 configurations, 5 randomizations each |
(10,) | (2, 3, 10) | 10 configurations, 2×3=6 randomizations each |
(4, 1) | (4, 5) | 4 configurations, 5 randomizations each |
(4, 3) | (2, 4, 3) | 4×3=12 configurations, 2 randomizations each |
(4, 3) | (2, 1, 3) | 4×3=12 configurations, 2 randomizations each (the 1 expands to 4) |