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

Method make_from_offset_elem

src/core/impl/tensor.cpp:92–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90/* ============= Slice and SubTensorSpec ============= */
91
92SubTensorSpec SubTensorSpec::make_from_offset_elem(
93 const TensorLayout& layout, ptrdiff_t offset_elem) {
94 mgb_assert(layout.ndim && layout.dtype.valid());
95 return {layout, offset_elem};
96}
97
98SubTensorSpec Slice::apply(TensorLayout layout, int axis) const {
99 mgb_assert(layout.ndim > 0 && layout.dtype.valid());

Callers

nothing calls this directly

Calls 1

validMethod · 0.45

Tested by

no test coverage detected