pub enum LayerCheckpoint {
Show 18 variants
Linear {
in_features: usize,
out_features: usize,
weight: TensorSnapshot,
bias: TensorSnapshot,
},
ReLU,
LeakyReLU {
negative_slope: f32,
},
Sigmoid,
Tanh,
Dropout {
rate: f32,
},
Conv2d {
in_channels: usize,
out_channels: usize,
kernel_h: usize,
kernel_w: usize,
stride_h: usize,
stride_w: usize,
weight: TensorSnapshot,
bias: Option<TensorSnapshot>,
},
BatchNorm2d {
num_features: usize,
epsilon: f32,
gamma: TensorSnapshot,
beta: TensorSnapshot,
running_mean: TensorSnapshot,
running_var: TensorSnapshot,
},
MaxPool2d {
kernel_h: usize,
kernel_w: usize,
stride_h: usize,
stride_w: usize,
},
AvgPool2d {
kernel_h: usize,
kernel_w: usize,
stride_h: usize,
stride_w: usize,
},
Flatten,
GlobalAvgPool2d,
Softmax,
Embedding {
num_embeddings: usize,
embedding_dim: usize,
weight: TensorSnapshot,
},
LayerNorm {
normalized_shape: usize,
eps: f32,
gamma: TensorSnapshot,
beta: TensorSnapshot,
},
GroupNorm {
num_groups: usize,
num_channels: usize,
eps: f32,
gamma: TensorSnapshot,
beta: TensorSnapshot,
},
DepthwiseConv2d {
channels: usize,
kernel_h: usize,
kernel_w: usize,
stride_h: usize,
stride_w: usize,
weight: TensorSnapshot,
bias: Option<TensorSnapshot>,
},
SeparableConv2d {
in_channels: usize,
out_channels: usize,
kernel_h: usize,
kernel_w: usize,
stride_h: usize,
stride_w: usize,
depthwise_weight: TensorSnapshot,
pointwise_weight: TensorSnapshot,
bias: Option<TensorSnapshot>,
},
}Expand description
Serializable layer checkpoint payload.
Variants§
Linear
ReLU
LeakyReLU
Sigmoid
Tanh
Dropout
Conv2d
BatchNorm2d
Fields
§
gamma: TensorSnapshot§
beta: TensorSnapshot§
running_mean: TensorSnapshot§
running_var: TensorSnapshotMaxPool2d
AvgPool2d
Flatten
GlobalAvgPool2d
Softmax
Embedding
LayerNorm
GroupNorm
DepthwiseConv2d
SeparableConv2d
Trait Implementations§
Source§impl Clone for LayerCheckpoint
impl Clone for LayerCheckpoint
Source§fn clone(&self) -> LayerCheckpoint
fn clone(&self) -> LayerCheckpoint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayerCheckpoint
impl Debug for LayerCheckpoint
Source§impl<'de> Deserialize<'de> for LayerCheckpoint
impl<'de> Deserialize<'de> for LayerCheckpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LayerCheckpoint
impl PartialEq for LayerCheckpoint
Source§impl Serialize for LayerCheckpoint
impl Serialize for LayerCheckpoint
impl StructuralPartialEq for LayerCheckpoint
Auto Trait Implementations§
impl Freeze for LayerCheckpoint
impl RefUnwindSafe for LayerCheckpoint
impl Send for LayerCheckpoint
impl Sync for LayerCheckpoint
impl Unpin for LayerCheckpoint
impl UnsafeUnpin for LayerCheckpoint
impl UnwindSafe for LayerCheckpoint
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