pub struct ConvTranspose1d { /* private fields */ }Expand description
Named-channel 1D transposed convolution; see ConvTranspose2d for the shared contract.
Reuses ConvTranspose2d’s exact geometry and initialization over a synthetic unit spatial
axis, exactly as Conv1d reuses Conv2d.
Implementations§
Source§impl ConvTranspose1d
impl ConvTranspose1d
pub fn new(input: Axis, output: Dim, spatial: Axis, kernel: usize) -> Self
Sourcepub fn stride(self, stride: usize) -> Self
pub fn stride(self, stride: usize) -> Self
Set stride along the one real spatial axis. Defaults to 1.
Sourcepub fn padding(self, padding: usize) -> Self
pub fn padding(self, padding: usize) -> Self
Set symmetric zero-padding along the one real spatial axis. Defaults to 0.
Sourcepub fn output_padding(self, output_padding: usize) -> Self
pub fn output_padding(self, output_padding: usize) -> Self
Set output padding along the one real spatial axis. Must be less than stride. Defaults to 0.
Sourcepub fn groups(self, groups: usize) -> Self
pub fn groups(self, groups: usize) -> Self
Partition input and output channels into independent convolution groups.
Sourcepub fn bias(self, bias: bool) -> Self
pub fn bias(self, bias: bool) -> Self
Disable the learned bias term, matching crate::Linear::bias. Has no effect once build
has already allocated parameters; call it before build.
Trait Implementations§
Source§impl Module for ConvTranspose1d
impl Module for ConvTranspose1d
fn output_shape(&self, input: &Shape) -> Result<Shape>
Source§fn build(&mut self, input: &Shape, device: &Device, seed: u64) -> Result<Shape>
fn build(&mut self, input: &Shape, device: &Device, seed: u64) -> Result<Shape>
Infer extents, validate contracts, allocate and initialize parameters; never run forward.
Rebuilding with compatible extents/device preserves parameters and ignores the new seed.
Source§fn forward(&self, input: &Tensor) -> Result<Tensor>
fn forward(&self, input: &Tensor) -> Result<Tensor>
Evaluation semantics: no mode flag on
self, no randomness beyond what
forward itself already defines. This never changes with the arrival
of forward_training.Source§fn named_parameters(&self) -> Vec<(String, Parameter)>
fn named_parameters(&self) -> Vec<(String, Parameter)>
Structural paths identify slots; ParamId identifies shared storage within this process.
Source§fn forward_training(
&self,
input: &Tensor,
pass: &mut TrainingPass,
) -> Result<Tensor>
fn forward_training( &self, input: &Tensor, pass: &mut TrainingPass, ) -> Result<Tensor>
Training-mode forward pass, driven by an explicit
TrainingPass
rather than a flag on self. The default implementation ignores
pass and calls Module::forward, which is exactly today’s
behavior for every module without a train/eval distinction. Override
this (never forward, which must stay evaluation semantics) to add
explicit randomness or a train/eval difference, such as Dropout.
A container that holds child modules (Sequential, or any future
one) overrides this to thread the same pass through every child in
order, so their draws stay distinct within one step.fn parameter(&self, name: &str) -> Result<Parameter>
fn parameters(&self) -> Vec<Parameter>
fn zero_grad(&self)
Source§fn named_states(&self) -> Vec<(String, State)>
fn named_states(&self) -> Vec<(String, State)>
Persistent non-parameter tensors this module owns across training
steps –
BatchNorm-style running statistics. Same slot-path
convention as Module::named_parameters: a container (Sequential
or any future one) aggregates every child’s own states under
"{index}.{name}". Defaults empty, exactly like named_parameters,
since most modules have no persistent state. A State here is never
written directly; only TrainingPass::commit writes one, after
staging in forward_training.fn state(&self, name: &str) -> Result<State>
fn states(&self) -> Vec<State>
Auto Trait Implementations§
impl !RefUnwindSafe for ConvTranspose1d
impl !Send for ConvTranspose1d
impl !Sync for ConvTranspose1d
impl !UnwindSafe for ConvTranspose1d
impl Freeze for ConvTranspose1d
impl Unpin for ConvTranspose1d
impl UnsafeUnpin for ConvTranspose1d
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