pub struct Gradients {
pub query_grad: Vec<f32>,
pub keys_grad: Vec<Vec<f32>>,
pub values_grad: Vec<Vec<f32>>,
pub attention_weights_grad: Option<Vec<f32>>,
}Expand description
Gradient information for backward pass.
Fields§
§query_grad: Vec<f32>Gradient w.r.t. query
keys_grad: Vec<Vec<f32>>Gradient w.r.t. keys
values_grad: Vec<Vec<f32>>Gradient w.r.t. values
attention_weights_grad: Option<Vec<f32>>Gradient w.r.t. attention weights (for analysis)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Gradients
impl RefUnwindSafe for Gradients
impl Send for Gradients
impl Sync for Gradients
impl Unpin for Gradients
impl UnwindSafe for Gradients
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