Class SubTensorSpec

Class Documentation

class mgb::SubTensorSpec

specify how a subtensor resides in a larger one

Public Functions

SubTensorSpec() = default
const TensorLayout &layout() const

get underlying layout

ptrdiff_t offset_elem() const

get offset in number of logical elements in the layout

ptrdiff_t offset_byte() const

get offset measured in bytes

void merge_with(const SubTensorSpec &rhs)

merge with another SubTensorSpec: accum offset, and replace layout by rhs

Public Static Functions

SubTensorSpec make_from_layout(const TensorLayout &layout)

make a SubTensorSpec from given layout and zero offset

SubTensorSpec make_from_offset_elem(const TensorLayout &layout, ptrdiff_t offset_elem)

make a SubTensorSpec from given layout and offset