Skip to main content

ArgReducePlan

Struct ArgReducePlan 

Source
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>

Source

pub fn select( _stream: &Stream, desc: &ArgReduceDescriptor<N>, _pref: PlanPreference, ) -> Result<Self>

Pick a kernel for desc.

Source

pub fn can_implement(&self, args: &ArgReduceArgs<'_, T, N, I>) -> Result<()>

Validate args.

Source

pub fn workspace_size(&self) -> usize

Workspace size in bytes.

Source

pub fn sku(&self) -> KernelSku

Identity of the kernel this plan picked.

Source

pub fn precision_guarantee(&self) -> PrecisionGuarantee

Numerical guarantees.

Source

pub fn run( &self, stream: &Stream, _workspace: Workspace<'_>, args: ArgReduceArgs<'_, T, N, I>, ) -> Result<()>

Launch.

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>

§

impl<T, const N: usize, I> Send for ArgReducePlan<T, N, I>
where T: Send, I: Send,

§

impl<T, const N: usize, I> Sync for ArgReducePlan<T, N, I>
where T: Sync, I: Sync,

§

impl<T, const N: usize, I> Unpin for ArgReducePlan<T, N, I>
where T: Unpin, I: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.