pub struct ArgReducePlan<T: Element, const N: usize, I: IndexOutputElement = i64> { /* private fields */ }Expand description
Arg-reduce plan (argmax / argmin) — see module docs for dtypes, tie-breaking, and precision.
T: Element is the value (input) dtype; I: IndexOutputElement is
the output index dtype (defaults to i64). const N: usize is the
tensor rank (1..=8).
The I = i64 default preserves source-compat for pre-Phase-12.2
callers; new callers opt into narrower output dtypes via
ArgReducePlan::<T, N, u32>::select(...) or <T, N, i32>.
Implementations§
Source§impl<T: Element, const N: usize, I: IndexOutputElement> ArgReducePlan<T, N, I>
impl<T: Element, const N: usize, I: IndexOutputElement> ArgReducePlan<T, N, I>
Sourcepub fn select(
_stream: &Stream,
desc: &ArgReduceDescriptor<N>,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &ArgReduceDescriptor<N>, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel for desc.
Sourcepub fn can_implement(&self, args: &ArgReduceArgs<'_, T, N, I>) -> Result<()>
pub fn can_implement(&self, args: &ArgReduceArgs<'_, T, N, I>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size in bytes.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<T, const N: usize, I> Freeze for ArgReducePlan<T, N, I>
impl<T, const N: usize, I> RefUnwindSafe for ArgReducePlan<T, N, I>where
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<T, const N: usize, I> Send for ArgReducePlan<T, N, I>
impl<T, const N: usize, I> Sync for ArgReducePlan<T, N, I>
impl<T, const N: usize, I> Unpin for ArgReducePlan<T, N, I>
impl<T, const N: usize, I> UnsafeUnpin for ArgReducePlan<T, N, I>
impl<T, const N: usize, I> UnwindSafe for ArgReducePlan<T, N, I>where
T: UnwindSafe,
I: UnwindSafe,
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