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

Method offset_byte

src/core/include/megbrain/tensor.h:52–58  ·  view source on GitHub ↗

get offset measured in bytes

Source from the content-addressed store, hash-verified

50
51 //! get offset measured in bytes
52 ptrdiff_t offset_byte() const {
53 //! for lowbit cases, offset must aligned to bytes
54 mgb_assert(
55 !m_layout.dtype.is_low_bit() ||
56 !(m_offset_elem * m_layout.dtype.low_bit() % 8));
57 return m_layout.dtype.size(m_offset_elem);
58 }
59
60 /*!
61 * \brief merge with another SubTensorSpec: accum offset, and replace

Callers 5

tensor.cppFile · 0.80
var_node.cppFile · 0.80
fwd_in2out_readonlyMethod · 0.80
do_executeMethod · 0.80
mixin_rofwd_executeMethod · 0.80

Calls 3

is_low_bitMethod · 0.80
low_bitMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected