MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / compute_end_dim

Function compute_end_dim

src/shape_transform_descriptor.cpp:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45template <class Iterator, class Projection>
46static auto compute_end_dim(Iterator start, Iterator last, std::size_t dim, Projection proj)
47{
48 std::size_t x = 1;
49 auto it = std::find_if(start, last, [&](auto d) {
50 x *= proj(d);
51 return x == dim;
52 });
53 if(it != last)
54 return it;
55 return start;
56}
57
58[[maybe_unused]] static void debug_print(const std::vector<dimension::sub>& subs)
59{

Callers 1

apply_reshape_implMethod · 0.70

Calls 1

find_ifFunction · 0.50

Tested by

no test coverage detected