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

Method make

imperative/src/impl/physical_tensor.cpp:648–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646 m_dtype(layout.dtype) {}
647
648TensorPtr Tensor::make(const HostTensorND& hv) {
649 auto&& blob = MultiCNConstTensorCache::inst().lookup(hv);
650 if (blob) {
651 return make(std::forward<decltype(blob)>(blob), hv.layout(), hv);
652 }
653 return std::make_shared<Tensor>(hv);
654}
655
656void Tensor::to_contiguous_inplace(VarNode::LayoutConstraintCallback& layout_checker) {
657 MGB_LOCK_GUARD(m_blob_mtx);

Callers

nothing calls this directly

Calls 4

instFunction · 0.85
makeFunction · 0.70
lookupMethod · 0.45
layoutMethod · 0.45

Tested by

no test coverage detected