Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove autodiff from wgan generate #2759

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions examples/wgan/examples/wgan-generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,18 @@ pub fn launch<B: Backend>(device: B::Device) {
feature = "ndarray-blas-accelerate",
))]
mod ndarray {
use burn::backend::{
ndarray::{NdArray, NdArrayDevice},
Autodiff,
};
use burn::backend::ndarray::{NdArray, NdArrayDevice};

use crate::launch;

pub fn run() {
launch::<Autodiff<NdArray>>(NdArrayDevice::Cpu);
launch::<NdArray>(NdArrayDevice::Cpu);
}
}

#[cfg(feature = "tch-gpu")]
mod tch_gpu {
use burn::backend::{
libtorch::{LibTorch, LibTorchDevice},
Autodiff,
};
use burn::backend::libtorch::{LibTorch, LibTorchDevice};

use crate::launch;

Expand All @@ -38,41 +32,38 @@ mod tch_gpu {
#[cfg(target_os = "macos")]
let device = LibTorchDevice::Mps;

launch::<Autodiff<LibTorch>>(device);
launch::<LibTorch>(device);
}
}

#[cfg(feature = "tch-cpu")]
mod tch_cpu {
use burn::backend::{
libtorch::{LibTorch, LibTorchDevice},
Autodiff,
};
use burn::backend::libtorch::{LibTorch, LibTorchDevice};

use crate::launch;

pub fn run() {
launch::<Autodiff<LibTorch>>(LibTorchDevice::Cpu);
launch::<LibTorch>(LibTorchDevice::Cpu);
}
}

#[cfg(feature = "wgpu")]
mod wgpu {
use crate::launch;
use burn::backend::{wgpu::Wgpu, Autodiff};
use burn::backend::wgpu::Wgpu;

pub fn run() {
launch::<Autodiff<Wgpu>>(Default::default());
launch::<Wgpu>(Default::default());
}
}

#[cfg(feature = "cuda")]
mod cuda {
use crate::launch;
use burn::backend::{Autodiff, Cuda};
use burn::backend::Cuda;

pub fn run() {
launch::<Autodiff<Cuda>>(Default::default());
launch::<Cuda>(Default::default());
}
}

Expand Down