pub struct SegmentProdPlan<T: Element> { /* private fields */ }Expand description
segment_prod plan (sorted, FW only).
out[s, d] = Π_{n : segment_ids[n] == s} input[n, d]. Sorted
segment-product.
When to use: forward sorted segment-product. No BW plan —
would need numerically-stable prod / x_n per-input divides
(deferred).
Dtypes: {f32, f64}.
Shape limits: input [N, D]; segment_ids [N];
output [num_segments, D].
Workspace: none.
Precision guarantee: deterministic, bit-stable.
Index policy: out-of-range IDs dropped. Empty segments emit identity (1.0).
Implementations§
Source§impl<T: Element> SegmentProdPlan<T>
impl<T: Element> SegmentProdPlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &SegmentProdDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &SegmentProdDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel.
Sourcepub fn can_implement(&self, args: &SegmentProdArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &SegmentProdArgs<'_, T>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size — zero.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<T> Freeze for SegmentProdPlan<T>
impl<T> RefUnwindSafe for SegmentProdPlan<T>where
T: RefUnwindSafe,
impl<T> Send for SegmentProdPlan<T>where
T: Send,
impl<T> Sync for SegmentProdPlan<T>where
T: Sync,
impl<T> Unpin for SegmentProdPlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for SegmentProdPlan<T>
impl<T> UnwindSafe for SegmentProdPlan<T>where
T: 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