| 107 | } |
| 108 | |
| 109 | std::vector<std::size_t> compute_common_lens(const std::vector<shape>& shapes) |
| 110 | { |
| 111 | assert(not shapes.empty()); |
| 112 | assert( |
| 113 | std::none_of(shapes.cbegin(), shapes.cend(), [](auto shape) { return shape.dynamic(); })); |
| 114 | return transform_accumulate(shapes.begin() + 1, |
| 115 | shapes.end(), |
| 116 | shapes.front().lens(), |
| 117 | &compute_broadcasted_lens, |
| 118 | [](auto s) { return s.lens(); }); |
| 119 | } |
| 120 | |
| 121 | static shape::type_t compute_common_type(shape::type_t t1, shape::type_t t2) |
| 122 | { |