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

Function load_tensor_layout

src/serialization/impl/serializer_oss.cpp:615–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615TensorLayout load_tensor_layout(const fbs::Tensor* tensor) {
616 TensorLayout layout;
617 if (tensor->shape()) {
618 layout.ndim = tensor->shape()->size();
619 std::copy(tensor->shape()->begin(), tensor->shape()->end(), layout.shape);
620 }
621 if (tensor->dtype()) {
622 // modify data type inplace for TensorLayout
623 layout.modify_dtype_inplace(fbs::intl::load_dtype(tensor->dtype()));
624 }
625 layout.init_contiguous_stride();
626 return layout;
627}
628
629void GraphLoaderOSS::OprLoadContextImpl::load_tensor_value(
630 HostTensorND* dest, const TensorLayout& layout, const fbs::Tensor* tensor) {

Callers 2

load_tensorMethod · 0.85
load_tensor_sharedMethod · 0.85

Calls 9

load_dtypeFunction · 0.85
modify_dtype_inplaceMethod · 0.80
copyFunction · 0.50
shapeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected