pub struct AbstractLengthsOp<TData, TLengths, Context, R: Reducer, const SparseFused: bool, InputAccessor> { /* private fields */ }
Expand description
| @brief Segment reduction op with optional fused
| embedding lookup
|
| Base implementation for LengthsXXX and
| SparseLengthsXXX depending on SparseFused static
| argument.
|
| Inputs:
| 0: DATA - input embedding to do lookups in
| 1..P: AUX_ARG_ - optional additional arguments to be passed to the
| reducer, should have the same first dimension as
| LENGTHS (e.g. scalars in WeightedSum)
| # if SparseFused == true:
| P+1: INDICES - 1-D vector with indices to look up in DATA. Should have the
| same dimension as LENGTHS
| # P+1 if SparseFused == false:
| P+1 or P+2: LENGTHS - lengths on indecies vector
|
| Output:
| Tensor with first dimension of K, where K = len(LENGTHS). Rest
| of dimensions are decided by reducer but usually are the same size as extra
| dimensions of DATA
|
| bool SparseFused = true,
| class InputAccessor = BaseInputAccessor
Implementations§
source§impl<TData, TLengths, Context, R: Reducer, const SparseFused: bool, InputAccessor> AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>
impl<TData, TLengths, Context, R: Reducer, const SparseFused: bool, InputAccessor> AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>
pub fn run_on_device(&mut self) -> bool
pub fn do_run_with_type<IndexType>(&mut self) -> bool
pub fn do_run_with_value<IndexType, const FixedSize: i32>(&mut self) -> bool
Auto Trait Implementations§
impl<TData, TLengths, Context, R, const SparseFused: bool, InputAccessor> !RefUnwindSafe for AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>
impl<TData, TLengths, Context, R, const SparseFused: bool, InputAccessor> !Send for AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>
impl<TData, TLengths, Context, R, const SparseFused: bool, InputAccessor> !Sync for AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>
impl<TData, TLengths, Context, R, const SparseFused: bool, InputAccessor> Unpin for AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>where Context: Unpin, InputAccessor: Unpin, R: Unpin, TData: Unpin, TLengths: Unpin,
impl<TData, TLengths, Context, R, const SparseFused: bool, InputAccessor> !UnwindSafe for AbstractLengthsOp<TData, TLengths, Context, R, SparseFused, InputAccessor>
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.