pub enum OpKind {
Show 53 variants
Embedding,
Range,
Neg,
Relu,
Gelu,
Silu,
Sigmoid,
Tanh,
Exp,
Log,
Sqrt,
Transpose,
Add,
Sub,
Mul,
Div,
Mod,
Pow,
MatMul,
Sum {
dims: Vec<i64>,
keepdim: bool,
},
Mean {
dims: Vec<i64>,
keepdim: bool,
},
Max {
dim: i64,
keepdim: bool,
},
Min {
dim: i64,
keepdim: bool,
},
Variance {
dims: Vec<i64>,
keepdim: bool,
},
LayerNorm {
eps: f64,
},
BatchNorm {
eps: f64,
},
MultiHeadAttention {
n_heads: i64,
},
TransformerBlock {
n_heads: i64,
},
Softmax {
dim: i64,
},
Reshape {
target_shape: Vec<Dim>,
},
View {
target_shape: Vec<Dim>,
},
Permute {
dims: Vec<i64>,
},
Concat {
dim: i64,
},
Split {
dim: i64,
chunks: i64,
},
Expand {
target_shape: Vec<Dim>,
},
Dropout {
p: f64,
},
Linear {
bias: bool,
},
CrossEntropy,
MseLoss,
Equal,
NotEqual,
Less,
Greater,
LessEqual,
GreaterEqual,
And,
Or,
Not,
Constant(ConstantValue),
Repeat {
count: i64,
body_op: Box<OpKind>,
},
Custom {
name: String,
attrs: HashMap<String, AttrValue>,
},
Call {
graph_name: String,
},
Identity,
}Expand description
An operation in the computation graph.
Variants§
Embedding
Look up rows in an embedding table.
Range
Generate a range of values.
Neg
Relu
Gelu
Silu
Sigmoid
Tanh
Exp
Log
Sqrt
Transpose
Add
Sub
Mul
Div
Mod
Pow
MatMul
Sum
Mean
Max
Min
Variance
LayerNorm
BatchNorm
MultiHeadAttention
TransformerBlock
Softmax
Reshape
View
Permute
Concat
Split
Expand
Dropout
Linear
CrossEntropy
MseLoss
Equal
NotEqual
Less
Greater
LessEqual
GreaterEqual
And
Or
Not
Constant(ConstantValue)
Repeat
Custom
Call
Identity
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpKind
impl RefUnwindSafe for OpKind
impl Send for OpKind
impl Sync for OpKind
impl Unpin for OpKind
impl UnwindSafe for OpKind
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