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

Function shape_abc

src/opr/test/misc.cpp:17–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16namespace {
17void shape_abc(const TensorShape& shape, size_t axis, size_t& A, size_t& B, size_t& C) {
18 auto acc_mul = [](const size_t* first, const size_t* last) {
19 return std::accumulate(first, last, 1u, std::multiplies<size_t>());
20 };
21 A = acc_mul(shape.shape, shape.shape + axis);
22 B = shape.shape[axis];
23 C = acc_mul(shape.shape + axis + 1, shape.shape + shape.ndim);
24}
25
26void argsort_data_gen(HostTensorND& dest) {
27 mgb_assert(dest.layout().ndim == 2 && dest.layout().is_contiguous());

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected