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

Function make_bcast_shape

src/common.cpp:238–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238shape make_bcast_shape(const shape& input_shape, const std::vector<std::size_t>& bcast_lens)
239{
240 assert(not input_shape.dynamic());
241 auto offset = bcast_lens.size() - input_shape.ndim();
242 std::vector<size_t> bcast_strides(bcast_lens.size(), 0);
243 for(std::ptrdiff_t i : reverse(range(input_shape.ndim())))
244 {
245 if(bcast_lens.at(i + offset) == input_shape.lens()[i])
246 {
247 bcast_strides.at(i + offset) = input_shape.strides()[i];
248 }
249 }
250 return shape{input_shape.type(), bcast_lens, bcast_strides};
251}
252
253} // namespace MIGRAPHX_INLINE_NS
254} // namespace migraphx

Callers 3

compute_shapeMethod · 0.85
compute_shapeMethod · 0.85
computeMethod · 0.85

Calls 8

dynamicMethod · 0.80
ndimMethod · 0.80
atMethod · 0.80
lensMethod · 0.80
reverseFunction · 0.50
rangeFunction · 0.50
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected