shape<dense_dim<0, 10>, dim<>> s({}, {0, 20});
auto compact = make_compact(s);
Currently, compact will be of the same shape type as s. However, we could produce shape<dense_dim<0, 10>, strided_dim<10>> safely instead.
This arises in practice when tiling algorithms:
for (auto yo : split<4>(output.y()) {
for (auto xo : split<4>(output.x()) {
auto output_tile = input(xo, yo);
auto tile_buffer = make_array<T>(make_compact(output_tile.shape()));
}
}
In an example like this, we'd like tile_buffer.shape().y().stride() to evaluate to a constant, rather than a runtime value.
Currently, compact will be of the same shape type as s. However, we could produce
shape<dense_dim<0, 10>, strided_dim<10>>
safely instead.This arises in practice when tiling algorithms:
In an example like this, we'd like
tile_buffer.shape().y().stride()
to evaluate to a constant, rather than a runtime value.