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

Method dimshuffle

dnn/src/common/basic_types.cpp:231–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231TensorLayout TensorLayout::dimshuffle(const std::vector<size_t>& dims) const {
232 TensorLayout res{dtype, format};
233 res.ndim = this->ndim;
234 megdnn_assert_eq_size_t(dims.size(), this->ndim);
235 auto ndim = this->ndim;
236 rep(i, ndim) {
237 auto dest = dims[i];
238 megdnn_assert(dest < ndim);
239 res.shape[i] = this->shape[dest];
240 res.stride[i] = this->stride[dest];
241 }
242 return res;
243}
244
245TensorLayout TensorLayout::remove_axis(size_t idx) const {
246 TensorLayout res{*this};

Callers 15

apply_on_physical_tensorFunction · 0.80
emitMethod · 0.80
TEST_FFunction · 0.80
DEF_TESTFunction · 0.80
TESTFunction · 0.80
TEST_FFunction · 0.80
run_matmul_mk_formatFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
benchmark_target_algoFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 10

TEST_FFunction · 0.64
DEF_TESTFunction · 0.64
TESTFunction · 0.64
TEST_FFunction · 0.64
run_matmul_mk_formatFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
benchmark_target_algoFunction · 0.64