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

Method Tensor

imperative/src/impl/physical_tensor.cpp:587–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587Tensor::Tensor(
588 BlobPtr blob, const TensorLayout& layout, size_t offset, const HostTensorND& hv)
589 : m_cn(blob->comp_node()),
590 m_shape(layout),
591 m_dtype(layout.dtype),
592 m_layout(layout),
593 m_blob(std::move(blob)),
594 m_offset(offset),
595 m_value(hv) {}
596
597Tensor::Tensor(const HostTensorND& hv) : Tensor(hv.layout(), hv.comp_node()) {
598 constexpr int size_threshold = TensorShape::MAX_NDIM;

Callers

nothing calls this directly

Calls 15

copy_from_fixlayoutMethod · 0.80
storageMethod · 0.80
dist_byteMethod · 0.80
spanMethod · 0.80
async_releaseFunction · 0.70
makeFunction · 0.70
comp_nodeMethod · 0.45
layoutMethod · 0.45
total_nr_elemsMethod · 0.45
raw_ptrMethod · 0.45
offsetMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected