← Back

Module broadcasting

fn broadcast_add[T; const N: u32](a: &NDArray[T; N], b: &NDArray[T; N]) -> NDArray[T; N]

Element-wise addition with broadcasting. The smaller array is virtually expanded to match the larger shape. Broadcast rules (same as NumPy but explicit): 1. Dimensions are compared right-to-left 2. Dimensions must match OR one must be 1 3. The output shape is the element-wise maximum

Source: broadcasting.joule:28

fn broadcast_sub[T; const N: u32](a: &NDArray[T; N], b: &NDArray[T; N]) -> NDArray[T; N]

Source: broadcasting.joule:32

fn broadcast_mul[T; const N: u32](a: &NDArray[T; N], b: &NDArray[T; N]) -> NDArray[T; N]

Source: broadcasting.joule:36

fn broadcast_div[T; const N: u32](a: &NDArray[T; N], b: &NDArray[T; N]) -> NDArray[T; N]

Source: broadcasting.joule:40

fn broadcast_shape[const N: u32](

Compute the broadcast shape of two arrays. Returns None if shapes are incompatible.

Source: broadcasting.joule:46

fn expand[T; const M: u32; const N: u32](

Expand an array to a new shape by setting stride=0 for broadcast dimensions.

Source: broadcasting.joule:60