| 646 | m_dtype(layout.dtype) {} |
| 647 | |
| 648 | TensorPtr 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 | |
| 656 | void Tensor::to_contiguous_inplace(VarNode::LayoutConstraintCallback& layout_checker) { |
| 657 | MGB_LOCK_GUARD(m_blob_mtx); |