pub struct Reduction;Expand description
A reduction op: D[mD] = reduce(A[mA]) with user-chosen reduce op.
Implementations§
Source§impl Reduction
impl Reduction
Sourcepub unsafe fn new<'h>(
handle: &'h Handle,
a: &TensorDescriptor<'h>,
modes_a: &[i32],
c: &TensorDescriptor<'h>,
modes_c: &[i32],
d: &TensorDescriptor<'h>,
modes_d: &[i32],
op_reduce: BinaryOp,
compute_desc: *const c_void,
) -> Result<OperationDescriptor<'h>>
pub unsafe fn new<'h>( handle: &'h Handle, a: &TensorDescriptor<'h>, modes_a: &[i32], c: &TensorDescriptor<'h>, modes_c: &[i32], d: &TensorDescriptor<'h>, modes_d: &[i32], op_reduce: BinaryOp, compute_desc: *const c_void, ) -> Result<OperationDescriptor<'h>>
Build a reduction. modes_d is a subset of modes_a — all
modes in a that do NOT appear in d are reduced. op_reduce
is ADD for sum, MUL for product, MAX/MIN for min-max.
§Safety
compute_desc must be null or valid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reduction
impl RefUnwindSafe for Reduction
impl Send for Reduction
impl Sync for Reduction
impl Unpin for Reduction
impl UnsafeUnpin for Reduction
impl UnwindSafe for Reduction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more