MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_ABC

Function get_ABC

dnn/src/common/reduce_helper.cpp:10–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace reduce {
9
10void get_ABC(const TensorShape& shape, size_t& A, size_t& B, size_t& C, size_t axis) {
11 auto shape_arr = shape.shape;
12 auto ndim = shape.ndim;
13 A = std::accumulate(shape_arr, shape_arr + axis, 1_z, SafeMultiplies<size_t>());
14 B = shape_arr[axis];
15 C = std::accumulate(
16 shape_arr + (axis + 1), shape_arr + ndim, 1_z, SafeMultiplies<size_t>());
17}
18
19void get_ABC(
20 const TensorShape& shape, size_t& A, size_t& B, size_t& C, size_t axis_start,

Callers 15

execMethod · 0.85
execMethod · 0.85
execMethod · 0.85
exec_fallbackMethod · 0.85
exec_optimizedMethod · 0.85
execMethod · 0.85
execMethod · 0.85
execMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected