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

Function find_missing_axes

src/shape_transform_descriptor.cpp:1256–1269  ·  view source on GitHub ↗

Find missing axes. This will store a mapping between the missing axis and the next available axis.

Source from the content-addressed store, hash-verified

1254// Find missing axes. This will store a mapping between the missing
1255// axis and the next available axis.
1256static std::map<std::size_t, std::size_t>
1257find_missing_axes(const std::map<std::size_t, std::vector<dimension::sub*>>& axes_map,
1258 std::size_t rank)
1259{
1260 std::map<std::size_t, std::size_t> missing_axes;
1261 for(auto axis : range(rank))
1262 {
1263 if(contains(axes_map, axis))
1264 continue;
1265 auto it = axes_map.upper_bound(axis);
1266 missing_axes[axis] = it == axes_map.end() ? rank : it->first;
1267 }
1268 return missing_axes;
1269}
1270
1271// Find broadcasted dimensions. This will store a map from the next axis
1272// to the indices of the previous dimensions that are being broadcasted.

Callers 1

simplifyMethod · 0.85

Calls 3

containsFunction · 0.85
rangeFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected