pub struct Tracer { /* private fields */ }Expand description
Records operations into an IR graph.
Implementations§
Source§impl Tracer
impl Tracer
Sourcepub fn input(&self, name: &str, dims: &[usize], dtype: DType) -> TracedTensor
pub fn input(&self, name: &str, dims: &[usize], dtype: DType) -> TracedTensor
Declare a graph input with static dimensions.
Sourcepub fn input_dyn(&self, name: &str, dims: &[Dim], dtype: DType) -> TracedTensor
pub fn input_dyn(&self, name: &str, dims: &[Dim], dtype: DType) -> TracedTensor
Declare a graph input with mixed static/dynamic dimensions.
Sourcepub fn param(&self, name: &str, dims: &[usize], dtype: DType) -> TracedTensor
pub fn param(&self, name: &str, dims: &[usize], dtype: DType) -> TracedTensor
Declare a parameter (weight) with static dimensions.
Sourcepub fn matmul(&self, lhs: TracedTensor, rhs: TracedTensor) -> TracedTensor
pub fn matmul(&self, lhs: TracedTensor, rhs: TracedTensor) -> TracedTensor
Matrix multiply.
Sourcepub fn layer_norm(
&self,
x: TracedTensor,
gamma: TracedTensor,
beta: TracedTensor,
eps: f32,
) -> TracedTensor
pub fn layer_norm( &self, x: TracedTensor, gamma: TracedTensor, beta: TracedTensor, eps: f32, ) -> TracedTensor
Layer normalization.
Sourcepub fn softmax(&self, x: TracedTensor, axis: i32) -> TracedTensor
pub fn softmax(&self, x: TracedTensor, axis: i32) -> TracedTensor
Softmax.
Sourcepub fn gather(
&self,
table: TracedTensor,
indices: TracedTensor,
axis: usize,
) -> TracedTensor
pub fn gather( &self, table: TracedTensor, indices: TracedTensor, axis: usize, ) -> TracedTensor
Gather (embedding lookup).
Auto Trait Implementations§
impl Freeze for Tracer
impl !RefUnwindSafe for Tracer
impl !Send for Tracer
impl !Sync for Tracer
impl Unpin for Tracer
impl UnsafeUnpin for Tracer
impl !UnwindSafe for Tracer
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> 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