Module shape_utils

Module shape_utils 

Source
Expand description

A module contains shape utilities

Functions§

compare_and_pad_shapes
pad shape to the shortter one, this is used for prepareing for matmul broadcast.
compare_and_pad_shapes_strides
pad shape and strides to the shortter one, this is used for prepareing for matmul broadcast.
get_broadcast_axes_from
Determines the axes along which broadcasting is required to match a desired result shape.
is_reshape_possible
Attempt to reshape an array without copying data. Translated from NumPy’s _attempt_nocopy_reshape function.
mt_intervals
Generates intervals for multi-threaded processing by dividing the outer loop into chunks.
mt_intervals_simd
Generates intervals for multi-threaded SIMD processing by dividing the outer loop into chunks.
predict_broadcast_shape
Predicts the broadcasted shape resulting from broadcasting two arrays.
try_pad_shape
Pads a shape with ones on the left to reach a specified length.
yield_one_after
Inserts a 1 into a shape vector immediately after a specified index.
yield_one_before
Inserts a dimension of size 1 before the specified index in a shape.