pub struct ScatterOperation<'c> { /* private fields */ }Expand description
A scatter operation. Scatter operation..
The values_out tensor is set to the values_in tensor with data modified as follows: data from the input tensor is inserted at the positions specified by the indices tensor. N is the number of batches, W the number of indices in each batch, K the range of each index and C the number data channels for each index. It is not permitted to repeat the same output index within a single SCATTER operation and so each output index occurs at most once. It follows that K >= W. In use cases that require multiple updates to the same output position, these must be decomposed into multiple SCATTER operations.
Implementations§
Source§impl<'c> ScatterOperation<'c>
impl<'c> ScatterOperation<'c>
Sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
Sourcepub fn builder(
context: &'c Context,
location: Location<'c>,
) -> ScatterOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c>, ) -> ScatterOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn values_out(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn values_in(&self) -> Result<Value<'c, '_>, Error>
pub fn indices(&self) -> Result<Value<'c, '_>, Error>
pub fn input(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
Source§impl<'c> Clone for ScatterOperation<'c>
impl<'c> Clone for ScatterOperation<'c>
Source§fn clone(&self) -> ScatterOperation<'c>
fn clone(&self) -> ScatterOperation<'c>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'c> Debug for ScatterOperation<'c>
impl<'c> Debug for ScatterOperation<'c>
Source§impl<'b> From<ScatterOperation<'b>> for TosaDialectOperation<'b>
impl<'b> From<ScatterOperation<'b>> for TosaDialectOperation<'b>
Source§fn from(op: ScatterOperation<'b>) -> Self
fn from(op: ScatterOperation<'b>) -> Self
Converts to this type from the input type.
Source§impl<'c> From<ScatterOperation<'c>> for Operation<'c>
impl<'c> From<ScatterOperation<'c>> for Operation<'c>
Source§fn from(operation: ScatterOperation<'c>) -> Self
fn from(operation: ScatterOperation<'c>) -> Self
Converts to this type from the input type.
Source§impl<'c> PartialEq for ScatterOperation<'c>
impl<'c> PartialEq for ScatterOperation<'c>
Source§impl<'c> TryFrom<Operation<'c>> for ScatterOperation<'c>
impl<'c> TryFrom<Operation<'c>> for ScatterOperation<'c>
impl<'c> Eq for ScatterOperation<'c>
impl<'c> StructuralPartialEq for ScatterOperation<'c>
Auto Trait Implementations§
impl<'c> Freeze for ScatterOperation<'c>
impl<'c> RefUnwindSafe for ScatterOperation<'c>
impl<'c> !Send for ScatterOperation<'c>
impl<'c> !Sync for ScatterOperation<'c>
impl<'c> Unpin for ScatterOperation<'c>
impl<'c> UnwindSafe for ScatterOperation<'c>
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