pub enum TensorOp {
Show 22 variants
Constant(ConstantOp),
Unary(UnaryOp, TensorRef),
Binary(BinaryOp, TensorRef, TensorRef),
Map(MapFn, TensorRef),
ZipWith(ZipFn, TensorRef, TensorRef),
Reduce(ReduceOp, Axis, TensorRef),
ReduceAll(ReduceOp, TensorRef),
Scan(ReduceOp, Axis, TensorRef),
Fold(FoldFn, TensorRef, TensorRef),
Reshape(Shape, TensorRef),
Slice(SliceSpec, TensorRef),
Transpose(Permutation, TensorRef),
Broadcast(Shape, TensorRef),
Concat(Axis, Vec<TensorRef>),
Split(Axis, Vec<usize>, TensorRef),
MatMul(TensorRef, TensorRef),
BatchMatMul(TensorRef, TensorRef),
Dot(TensorRef, TensorRef),
Outer(TensorRef, TensorRef),
Conv(ConvSpec, TensorRef, TensorRef),
Gather(Axis, TensorRef, TensorRef),
Scatter(Axis, TensorRef, TensorRef, TensorRef),
}Expand description
Tensor operations in the IR.
These operations form the building blocks of tensor computations. The fusion pass analyzes these to produce fused kernels.
Variants§
Constant(ConstantOp)
A constant tensor.
Unary(UnaryOp, TensorRef)
Unary elementwise operation.
Binary(BinaryOp, TensorRef, TensorRef)
Binary elementwise operation.
Map(MapFn, TensorRef)
Map a function over elements.
ZipWith(ZipFn, TensorRef, TensorRef)
Zip two tensors with a function.
Reduce(ReduceOp, Axis, TensorRef)
Reduce along an axis.
ReduceAll(ReduceOp, TensorRef)
Full reduction to scalar.
Scan(ReduceOp, Axis, TensorRef)
Scan (prefix sum) along an axis.
Fold(FoldFn, TensorRef, TensorRef)
Fold with initial value.
Reshape(Shape, TensorRef)
Reshape to a new shape.
Slice(SliceSpec, TensorRef)
Slice a region.
Transpose(Permutation, TensorRef)
Transpose (permute dimensions).
Broadcast(Shape, TensorRef)
Broadcast to a larger shape.
Concat(Axis, Vec<TensorRef>)
Concatenate along an axis.
Split(Axis, Vec<usize>, TensorRef)
Split along an axis.
MatMul(TensorRef, TensorRef)
Matrix multiplication.
BatchMatMul(TensorRef, TensorRef)
Batched matrix multiplication.
Dot(TensorRef, TensorRef)
Dot product.
Outer(TensorRef, TensorRef)
Outer product.
Conv(ConvSpec, TensorRef, TensorRef)
Convolution operation.
Gather(Axis, TensorRef, TensorRef)
Gather elements.
Scatter(Axis, TensorRef, TensorRef, TensorRef)
Scatter elements.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TensorOp
impl<'de> Deserialize<'de> for TensorOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TensorOp
impl RefUnwindSafe for TensorOp
impl Send for TensorOp
impl Sync for TensorOp
impl Unpin for TensorOp
impl UnsafeUnpin for TensorOp
impl UnwindSafe for TensorOp
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