broadcast_layout

Function broadcast_layout 

Source
pub fn broadcast_layout<D1, D2, D>(
    layout1: &Layout<D1>,
    layout2: &Layout<D2>,
    order: FlagOrder,
) -> Result<(Layout<D>, Layout<D>), Error>
where D1: DimDevAPI + DimMaxAPI<D2, Max = D>, D2: DimDevAPI, D: DimDevAPI,
Expand description

Layout broadcasting.

Dimensions that to be upcasted or expanded will have stride length of zero.

Note that zero stride length is generally not accepted, since different indices will point to the same memory, which is not expected in most cases for this library. But this will be convenient when we need to broadcast.

ยงSee also

broadcasting