pub struct SimpleDistributedDataParallel<T, M>{ /* private fields */ }Expand description
Simplified DistributedDataParallel for RusTorch RusTorch用簡略化DistributedDataParallel
Implementations§
Source§impl<T, M> SimpleDistributedDataParallel<T, M>
impl<T, M> SimpleDistributedDataParallel<T, M>
Sourcepub fn new(module: M, device_ids: Option<Vec<usize>>) -> RusTorchResult<Self>
pub fn new(module: M, device_ids: Option<Vec<usize>>) -> RusTorchResult<Self>
Create a new simplified DDP wrapper 新しい簡略化DDPラッパーを作成
Sourcepub fn forward(&self, input: &Variable<T>) -> RusTorchResult<Variable<T>>
pub fn forward(&self, input: &Variable<T>) -> RusTorchResult<Variable<T>>
Forward pass with distributed synchronization 分散同期付きフォワードパス
Sourcepub fn sync_gradients(&self) -> RusTorchResult<()>
pub fn sync_gradients(&self) -> RusTorchResult<()>
Synchronize gradients across all processes 全プロセス間での勾配同期
Sourcepub fn device_ids(&self) -> &[usize]
pub fn device_ids(&self) -> &[usize]
Get device IDs デバイスIDを取得
Sourcepub fn set_gradient_sync(&mut self, enabled: bool)
pub fn set_gradient_sync(&mut self, enabled: bool)
Enable or disable automatic gradient synchronization 自動勾配同期の有効/無効を設定
Trait Implementations§
Source§impl<T, M> DistributedDataParallelTrait<T> for SimpleDistributedDataParallel<T, M>
impl<T, M> DistributedDataParallelTrait<T> for SimpleDistributedDataParallel<T, M>
Source§fn device_ids(&self) -> &[usize]
fn device_ids(&self) -> &[usize]
Get device IDs for this DDP instance
このDDPインスタンスのデバイスIDを取得
Source§fn distributed_forward(
&self,
input: &Variable<T>,
) -> RusTorchResult<Variable<T>>
fn distributed_forward( &self, input: &Variable<T>, ) -> RusTorchResult<Variable<T>>
Perform distributed forward pass
分散フォワードパスを実行
Source§fn sync_gradients(&self) -> RusTorchResult<()>
fn sync_gradients(&self) -> RusTorchResult<()>
Synchronize gradients across processes
プロセス間での勾配同期
Auto Trait Implementations§
impl<T, M> Freeze for SimpleDistributedDataParallel<T, M>
impl<T, M> RefUnwindSafe for SimpleDistributedDataParallel<T, M>where
T: RefUnwindSafe,
impl<T, M> Send for SimpleDistributedDataParallel<T, M>
impl<T, M> Sync for SimpleDistributedDataParallel<T, M>
impl<T, M> Unpin for SimpleDistributedDataParallel<T, M>where
T: Unpin,
impl<T, M> UnwindSafe for SimpleDistributedDataParallel<T, M>where
T: UnwindSafe,
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> 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