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

Method valid_span

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

! * \brief whether given tensor span is valid in this storage */

Source from the content-addressed store, hash-verified

128 * \brief whether given tensor span is valid in this storage
129 */
130 bool valid_span(const TensorLayout::Span& span) const {
131 return m_comp_node.valid() &&
132 static_cast<ptrdiff_t>(m_offset) + span.low_byte >= 0 &&
133 span.high_byte <= size();
134 }
135
136 /*!
137 * \brief ensure that its space could hold at least sz bytes

Callers 2

tensor.cppFile · 0.80

Calls 1

validMethod · 0.45

Tested by

no test coverage detected