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

Function reduce_dims

src/reduce_dims.cpp:130–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130std::vector<shape> reduce_dims(const std::vector<shape>& shapes)
131{
132 if(shapes.empty())
133 return {};
134 auto result = shapes;
135 auto base = base_lens(shapes);
136 for(auto&& s : shapes)
137 {
138 if(s.lens().size() != base.size())
139 return shapes;
140 if(s.lens() == base)
141 continue;
142 auto mshape = mask_shape(s, base);
143 if(mshape.lens().size() != base.size())
144 return shapes;
145 result.push_back(mshape);
146 }
147 reduce_dim_all(result);
148 result.erase(result.begin() + shapes.size(), result.end());
149 return result;
150}
151
152} // namespace MIGRAPHX_INLINE_NS
153} // namespace migraphx

Callers 14

TEST_CASEFunction · 0.85
blas_shape_hipFunction · 0.85
blas_shapeFunction · 0.85
normalizeMethod · 0.85
compile_opMethod · 0.85
compile_opMethod · 0.85
compile_opMethod · 0.85
split_reduceFunction · 0.85
compile_opMethod · 0.85
compile_opMethod · 0.85
compile_opMethod · 0.85
compile_opMethod · 0.85

Calls 10

base_lensFunction · 0.85
mask_shapeFunction · 0.85
reduce_dim_allFunction · 0.85
lensMethod · 0.80
eraseMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected