pub enum ShapeOp {
Input,
Reshape {
target_shape: Vec<usize>,
},
Transpose {
axes: Vec<usize>,
},
Broadcast {
target_shape: Vec<usize>,
},
Concatenate {
axis: usize,
other: NodeId,
},
Stack {
axis: usize,
other: NodeId,
},
Squeeze {
axes: Option<Vec<usize>>,
},
Unsqueeze {
axes: Vec<usize>,
},
Slice {
ranges: Vec<(usize, usize)>,
},
Expand {
target_shape: Vec<usize>,
},
Flatten {
start_dim: usize,
end_dim: usize,
},
Permute {
dims: Vec<usize>,
},
}Expand description
Shape operation type
Variants§
Input
Input shape (leaf node)
Reshape
Reshape operation
Transpose
Transpose operation
Broadcast
Broadcast operation
Concatenate
Concatenate operation along axis
Stack
Stack operation along new axis
Squeeze
Squeeze operation (remove dimensions of size 1)
Unsqueeze
Unsqueeze operation (add dimensions of size 1)
Slice
Slice operation
Expand
Expand operation (broadcast without materialization)
Flatten
Flatten operation
Permute
Permute operation (generalized transpose)
Trait Implementations§
impl Eq for ShapeOp
impl StructuralPartialEq for ShapeOp
Auto Trait Implementations§
impl Freeze for ShapeOp
impl RefUnwindSafe for ShapeOp
impl Send for ShapeOp
impl Sync for ShapeOp
impl Unpin for ShapeOp
impl UnsafeUnpin for ShapeOp
impl UnwindSafe for ShapeOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more