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

Function transposed_shape

dnn/src/cuda/svd/opr_impl.cpp:14–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace cuda;
13
14TensorShape transposed_shape(const TensorShape& shape) {
15 SmallVector<size_t> tshape(shape.ndim);
16 for (size_t i = 0; i < shape.ndim; i++) {
17 tshape[i] = shape[i];
18 }
19 std::iter_swap(tshape.rbegin(), tshape.rbegin() + 1);
20 return tshape;
21}
22
23TensorLayout transposed_layout(const TensorLayout& layout) {
24 megdnn_assert(layout.ndim >= 2);

Callers 1

execMethod · 0.85

Calls 1

rbeginMethod · 0.80

Tested by

no test coverage detected