Skip to main content

copy_scale_into

Function copy_scale_into 

Source
pub fn copy_scale_into<D, S, A, Op>(
    dest: &mut StridedViewMut<'_, D>,
    src: &StridedView<'_, S, Op>,
    scale: A,
    exec: Exec<'_>,
) -> Result<()>
where A: Copy + Mul<S, Output = D> + Sync, D: Copy + Send + Sync, S: Copy + Send + Sync, Op: ElementOp<S>,
Expand description

Overwriting copy with scaling: dest[i] = scale * src[i].

Scale, source, and destination may have different element types.

ยงErrors

Returns StridedError::RankMismatch or StridedError::ShapeMismatch when the views describe different extents, and StridedError::NonInjectiveOutputLayout when the destination layout cannot be proven representable and injective: two logical indices name one offset, or the element count or address span is too large to represent. Nothing is written unless validation succeeds.