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

Method set_layout

lite/src/mge/tensor_impl.cpp:278–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void TensorImplDft::set_layout(const Layout& layout) {
279 bool host = is_host();
280 auto mgb_layout = to_impl_layout(layout);
281 if (host) {
282 m_host_tensor->dtype(mgb_layout.dtype);
283 m_host_tensor->resize(mgb_layout);
284 } else {
285 m_dev_tensor->dtype(mgb_layout.dtype);
286 m_dev_tensor->resize(mgb_layout);
287 }
288}
289
290void TensorImplDft::reshape(const Layout& layout) {
291 auto mgb_layout = to_impl_layout(layout);

Callers 4

make_output_specMethod · 0.45
update_inputMethod · 0.45

Calls 2

resizeMethod · 0.80
dtypeMethod · 0.45

Tested by

no test coverage detected