pub struct FloatMeta<D: Device> {
pub op: Option<Op<D>>,
pub requires_grad: RwLock<bool>,
}Fields§
§op: Option<Op<D>>§requires_grad: RwLock<bool>Implementations§
Source§impl<D: Device> FloatMeta<D>
impl<D: Device> FloatMeta<D>
pub fn op(&self) -> Option<&Op<D>>
pub fn requires_grad(&self) -> bool
pub fn set_requires_grad(&self, mode: bool)
Source§impl<D: Device> FloatMeta<D>
Records an op into a FloatMeta iff grad is globally enabled and record is
true (i.e. some input requires grad). Otherwise produces a plain value meta.
impl<D: Device> FloatMeta<D>
Records an op into a FloatMeta iff grad is globally enabled and record is
true (i.e. some input requires grad). Otherwise produces a plain value meta.
pub fn on_binary( lhs: &Tensor<D, Float>, rhs: &Tensor<D, Float>, op: BinaryOp, ) -> Self
pub fn on_binary_scalar(lhs: &Tensor<D, Float>, rhs: f64, op: BinaryOp) -> Self
pub fn on_unary(t: &Tensor<D, Float>, op: UnaryOp<f64>) -> Self
pub fn on_float_unary(t: &Tensor<D, Float>, op: FloatUnaryOp) -> Self
pub fn on_broadcast(t: &Tensor<D, Float>) -> Self
pub fn on_reduce(t: &Tensor<D, Float>, dims: &[usize], op: ReduceOp) -> Self
pub fn on_matmul(lhs: &Tensor<D, Float>, rhs: &Tensor<D, Float>) -> Self
pub fn on_narrow( t: &Tensor<D, Float>, dim: usize, start: usize, len: usize, ) -> Self
pub fn on_slice( t: &Tensor<D, Float>, dim: usize, start: usize, end: usize, step: usize, ) -> Self
pub fn on_reshape(t: &Tensor<D, Float>) -> Self
pub fn on_transpose(t: &Tensor<D, Float>, dim1: usize, dim2: usize) -> Self
pub fn on_permute(t: &Tensor<D, Float>, dims: Vec<usize>) -> Self
pub fn on_cat<A: AsRef<Tensor<D, Float>>>(args: &[A], dim: usize) -> Self
pub fn on_copy(t: &Tensor<D, Float>) -> Self
pub fn on_cast(t: &Tensor<D, Float>) -> Self
pub fn on_pick( mask: &Tensor<D, Bool>, tv: Option<&Tensor<D, Float>>, fv: Option<&Tensor<D, Float>>, ) -> Self
pub fn on_index_select( t: &Tensor<D, Float>, idx: &Tensor<D, Int>, dim: usize, ) -> Self
pub fn on_index_add( init: &Tensor<D, Float>, idx: &Tensor<D, Int>, src: &Tensor<D, Float>, dim: usize, ) -> Self
pub fn on_scatter_add( init: &Tensor<D, Float>, idx: &Tensor<D, Int>, src: &Tensor<D, Float>, dim: usize, ) -> Self
pub fn on_gather( src: &Tensor<D, Float>, idx: &Tensor<D, Int>, dim: usize, ) -> Self
pub fn on_rms_norm( input: &Tensor<D, Float>, weight: &Tensor<D, Float>, eps: f64, ) -> Self
pub fn on_softmax(input: &Tensor<D, Float>, dim: usize) -> Self
Trait Implementations§
Source§impl<D: Device> TensorMeta<D, Float> for FloatMeta<D>
impl<D: Device> TensorMeta<D, Float> for FloatMeta<D>
fn on_binary( lhs: &Tensor<D, Float>, rhs: &Tensor<D, Float>, op: BinaryOp, ) -> Self
fn on_binary_scalar(lhs: &Tensor<D, Float>, rhs: f64, op: BinaryOp) -> Self
fn on_unary(t: &Tensor<D, Float>, op: UnaryOp<f64>) -> Self
fn on_float_unary(t: &Tensor<D, Float>, op: FloatUnaryOp) -> Self
fn on_reduce(t: &Tensor<D, Float>, dims: &[usize], op: ReduceOp) -> Self
fn on_matmul(lhs: &Tensor<D, Float>, rhs: &Tensor<D, Float>) -> Self
fn on_broadcast(t: &Tensor<D, Float>) -> Self
fn on_narrow(t: &Tensor<D, Float>, dim: usize, start: usize, len: usize) -> Self
fn on_slice( t: &Tensor<D, Float>, dim: usize, start: usize, end: usize, step: usize, ) -> Self
fn on_reshape(t: &Tensor<D, Float>) -> Self
fn on_transpose(t: &Tensor<D, Float>, dim1: usize, dim2: usize) -> Self
fn on_permute(t: &Tensor<D, Float>, dims: Vec<usize>) -> Self
fn on_cat<A: AsRef<Tensor<D, Float>>>(args: &[A], dim: usize) -> Self
fn on_copy(t: &Tensor<D, Float>) -> Self
fn on_cast(t: &Tensor<D, Float>) -> Self
fn on_index_select( t: &Tensor<D, Float>, idx: &Tensor<D, Int>, dim: usize, ) -> Self
fn on_gather(src: &Tensor<D, Float>, idx: &Tensor<D, Int>, dim: usize) -> Self
fn on_index_add( init: &Tensor<D, Float>, idx: &Tensor<D, Int>, src: &Tensor<D, Float>, dim: usize, ) -> Self
fn on_scatter_add( init: &Tensor<D, Float>, idx: &Tensor<D, Int>, src: &Tensor<D, Float>, dim: usize, ) -> Self
fn on_pick( mask: &Tensor<D, Bool>, tv: Option<&Tensor<D, Float>>, fv: Option<&Tensor<D, Float>>, ) -> Self
fn on_rms_norm( input: &Tensor<D, Float>, weight: &Tensor<D, Float>, eps: f64, ) -> Self
fn on_softmax(input: &Tensor<D, Float>, dim: usize) -> Self
Auto Trait Implementations§
impl<D> !Freeze for FloatMeta<D>
impl<D> RefUnwindSafe for FloatMeta<D>
impl<D> Send for FloatMeta<D>
impl<D> Sync for FloatMeta<D>
impl<D> Unpin for FloatMeta<D>
impl<D> UnsafeUnpin for FloatMeta<D>
impl<D> UnwindSafe for FloatMeta<D>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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