| 1081 | } |
| 1082 | |
| 1083 | static void set_broadcast_dim(dimension& d, std::size_t axis) |
| 1084 | { |
| 1085 | if(d.subdimensions.empty()) |
| 1086 | d.subdimensions.push_back({1, {axis}}); |
| 1087 | else |
| 1088 | { |
| 1089 | assert(d.subdimensions.front().hidden_axis.empty()); |
| 1090 | d.subdimensions.front().hidden_axis = {axis}; |
| 1091 | } |
| 1092 | } |
| 1093 | |
| 1094 | // If an axis is split and some dimensions are hidden and others are not, then |
| 1095 | // remove the hidden axis so only the non-hidden axis is used in |