pub struct SplatOperation<'c> { /* private fields */ }
Expand description
A splat
operation. Tensor splat or broadcast operation.
Broadcast the operand to all elements of the result tensor. The operand is required to be of integer/index/float type, and the result tensor must be statically shaped.
Example:
%s = arith.constant 10.1 : f32
%t = tensor.splat %s : tensor<8x16xf32>
TODO: This operation is easy to extend to broadcast to dynamically shaped tensors:
// Broadcasts %s to a 2-d dynamically shaped tensor, with %m, %n binding
// to the sizes of the two dynamic dimensions.
%m = "foo"() : () -> (index)
%n = "bar"() : () -> (index)
%t = tensor.splat %s [%m, %n] : tensor<?x?xf32>
Implementations§
source§impl<'c> SplatOperation<'c>
impl<'c> SplatOperation<'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>
) -> SplatOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> SplatOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn aggregate(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn input(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<SplatOperation<'c>> for Operation<'c>
impl<'c> From<SplatOperation<'c>> for Operation<'c>
source§fn from(operation: SplatOperation<'c>) -> Self
fn from(operation: SplatOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for SplatOperation<'c>
impl<'c> !Send for SplatOperation<'c>
impl<'c> !Sync for SplatOperation<'c>
impl<'c> Unpin for SplatOperation<'c>
impl<'c> UnwindSafe for SplatOperation<'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