pub struct FromElementsOperation<'c> { /* private fields */ }
Expand description
A from_elements
operation. Tensor from elements operation..
Create a N-D tensor from a range of same-type arguments. The number of
provided elements
should equal to the number of the elements in the
result type. The elements
correspond to a flattened tensor.
Example:
tensor.from_elements %a, %b, %c, %d, %e, %f : tensor<2x3xindex>
will result in a tensor
[[%a, %b, %c] [%d, %e, %f]]
Implementations§
source§impl<'c> FromElementsOperation<'c>
impl<'c> FromElementsOperation<'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>
) -> FromElementsOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> FromElementsOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn elements(&self) -> impl Iterator<Item = Value<'c, '_>>
Trait Implementations§
source§impl<'c> From<FromElementsOperation<'c>> for Operation<'c>
impl<'c> From<FromElementsOperation<'c>> for Operation<'c>
source§fn from(operation: FromElementsOperation<'c>) -> Self
fn from(operation: FromElementsOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for FromElementsOperation<'c>
impl<'c> !Send for FromElementsOperation<'c>
impl<'c> !Sync for FromElementsOperation<'c>
impl<'c> Unpin for FromElementsOperation<'c>
impl<'c> UnwindSafe for FromElementsOperation<'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