Skip to main content

Module utils

Module utils 

Source

Structs§

CopyGeometry
A copy_nd zone: the output’s extents, and the strides each side walks it by.
Layout
One tensor’s layout as a kernel addresses it: an extent per axis and a stride per axis, a broadcast axis holding a stride of zero.

Enums§

BroadcastKind

Constants§

MAX_COPY_RANK
Highest rank the backends’ copy_nd kernels address.

Functions§

as_q40_tensor
as_quant_fact
check_strides_validity
compute_broadcast_strides
facts_to_device_facts
get_device_fact
get_device_facts
get_quant_fact
merge_axes_to_fit
Merges the adjacent axes every layout walks as one run, until the rank fits max_rank, and answers the rank reached.
merge_copy_axes
Merges a copy’s adjacent axes with merge_axes_to_fit until it fits MAX_COPY_RANK. The rank answered still exceeds it when the two layouts leave no pair to merge, which a caller must check before dispatching.
reshape_to_rank_2
reshape_to_rank_3