pub struct NumElementsOperation<'c> { /* private fields */ }
Expand description
A num_elements
operation. Returns the number of elements for a given shape.
Returns the number of elements for a given shape which is the product of
its extents. If the argument is of type shape
then the result will be of
type size
and potential errors will be propagated. Otherwise, if the
argument is and extent tensor tensor<?xindex>
then the result will be of
type index
.
Implementations§
source§impl<'c> NumElementsOperation<'c>
impl<'c> NumElementsOperation<'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>
) -> NumElementsOperationBuilder<'c, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> NumElementsOperationBuilder<'c, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn shape(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<NumElementsOperation<'c>> for Operation<'c>
impl<'c> From<NumElementsOperation<'c>> for Operation<'c>
source§fn from(operation: NumElementsOperation<'c>) -> Self
fn from(operation: NumElementsOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for NumElementsOperation<'c>
impl<'c> !Send for NumElementsOperation<'c>
impl<'c> !Sync for NumElementsOperation<'c>
impl<'c> Unpin for NumElementsOperation<'c>
impl<'c> UnwindSafe for NumElementsOperation<'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