pub struct Linear {
pub weight: Tensor,
pub bias: Option<Tensor>,
}Expand description
Linear layer
Fields§
§weight: Tensorweight
bias: Option<Tensor>bias
Implementations§
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Linear
impl<'a> IntoIterator for &'a Linear
Source§impl<'a> IntoIterator for &'a mut Linear
impl<'a> IntoIterator for &'a mut Linear
Source§impl Module for Linear
impl Module for Linear
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Tensor>
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Tensor>
Iterate over all tensors mutably
Source§fn iter_tensors<'a>(&'a self) -> impl Iterator<Item = (String, &'a Tensor)>
fn iter_tensors<'a>(&'a self) -> impl Iterator<Item = (String, &'a Tensor)>
Iterate over tensors without consuming the module
Source§fn iter_tensors_mut<'a>(
&'a mut self,
) -> impl Iterator<Item = (String, &'a mut Tensor)>
fn iter_tensors_mut<'a>( &'a mut self, ) -> impl Iterator<Item = (String, &'a mut Tensor)>
From tensors
Auto Trait Implementations§
impl Freeze for Linear
impl RefUnwindSafe for Linear
impl Send for Linear
impl Sync for Linear
impl Unpin for Linear
impl UnsafeUnpin for Linear
impl UnwindSafe for Linear
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