pub struct AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> { /* private fields */ }
Expand description
| Pulls in slices of the input tensor,
| groups them into segments and applies
| ‘{op}’ to each segment. Segments are
| defined by their LENGTHS.
|
| This op is basically Gather and Lengths{op}
| fused together.
|
| INDICES should contain integers in
| range 0..N-1 where N is the first dimension
| of DATA. INDICES represent which slices
| of DATA need to be pulled in.
|
| LENGTHS is a vector that defines slice
| sizes by first dimension of DATA. Values
| belonging to the same segment are aggregated
| together. sum(LENGTHS) has to match
| INDICES size.
|
| The first dimension of the output is
| equal to the number of input segment,
| i.e. len(LENGTHS)
. Other dimensions
| are inherited from the input tensor.
|
| {op_doc} bool GradientNeedIndices
| = false>
|
Implementations§
source§impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>
pub fn populate_schema(schema: &mut OpSchema)
Auto Trait Implementations§
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> RefUnwindSafe for AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: RefUnwindSafe, ReducerDef: RefUnwindSafe, SIndex: RefUnwindSafe, T: RefUnwindSafe,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> Send for AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: Send, ReducerDef: Send, SIndex: Send, T: Send,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> Sync for AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: Sync, ReducerDef: Sync, SIndex: Sync, T: Sync,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> Unpin for AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: Unpin, ReducerDef: Unpin, SIndex: Unpin, T: Unpin,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> UnwindSafe for AbstractSparseLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: UnwindSafe, ReducerDef: UnwindSafe, SIndex: UnwindSafe, T: UnwindSafe,
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.