pub struct AbstractLengthsDef<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> { /* private fields */ }
Expand description
| Applies ‘{op}’ to each segment of the | input tensor. Segments are defined | by their LENGTHS. LENGTHS is a vector | that maps each of the slices of | | DATA* to a particular segment. Values | belonging to the same segment are aggregated | together and considered for the ‘{op}’ | operation. | | For example LENGTHS = [2, 1] stands | for segments DATA[0..1] and DATA[2] | | The sum of elements in LENGTHS must | equal the number of elements in the first | dimension of DATA. The length of OUTPUT | is equal to the number of input segments, | i.e. len(LENGTHS). | | {op_doc} | | {extra} | | bool GradientNeedIndices = false> |
Implementations§
source§impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> AbstractLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> AbstractLengthsDef<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 AbstractLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: RefUnwindSafe, ReducerDef: RefUnwindSafe, SIndex: RefUnwindSafe, T: RefUnwindSafe,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> Send for AbstractLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: Send, ReducerDef: Send, SIndex: Send, T: Send,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> Sync for AbstractLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: Sync, ReducerDef: Sync, SIndex: Sync, T: Sync,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> Unpin for AbstractLengthsDef<T, SIndex, Context, ReducerDef, GradientNeedIndices>where Context: Unpin, ReducerDef: Unpin, SIndex: Unpin, T: Unpin,
impl<T, SIndex, Context, ReducerDef, const GradientNeedIndices: bool> UnwindSafe for AbstractLengthsDef<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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.