pub struct DimOperation<'c> { /* private fields */ }
Expand description
A dim
operation. Gets the specified extent from the shape of a shaped input.
Gets the extent indexed by dim
from the shape of the value
operand. If
the index is error or out-of-bound then it returns an invalid size if the
return type carries error information else the behavior is undefined.
This is a convenience op that performs the equivalent of getting the extent
of a shape (e.g., dim(x, i) == get_extent(shape_of(x), i)
).
Implementations§
source§impl<'c> DimOperation<'c>
impl<'c> DimOperation<'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>
) -> DimOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> DimOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn extent(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn value(&self) -> Result<Value<'c, '_>, Error>
pub fn index(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<DimOperation<'c>> for Operation<'c>
impl<'c> From<DimOperation<'c>> for Operation<'c>
source§fn from(operation: DimOperation<'c>) -> Self
fn from(operation: DimOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for DimOperation<'c>
impl<'c> !Send for DimOperation<'c>
impl<'c> !Sync for DimOperation<'c>
impl<'c> Unpin for DimOperation<'c>
impl<'c> UnwindSafe for DimOperation<'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