Fix clippy

This commit is contained in:
Guillaume Lagrange 2024-06-13 08:25:24 -04:00
parent f20a4b9643
commit 64ae3d697c
4 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,7 @@ use crate::{
tensor::AutodiffTensor,
AutodiffBridge,
};
use alloc::vec::Vec;
use burn_tensor::backend::{AutodiffBackend, Backend};
use core::marker::PhantomData;

View File

@ -1,3 +1,4 @@
use alloc::vec::Vec;
use burn_common::stub::RwLock;
use burn_compute::{
channel::MutexComputeChannel,
@ -24,7 +25,7 @@ impl burn_jit::JitRuntime for CudaRuntime {
fn list_available_devices() -> Vec<Self::JitDevice> {
(0..cudarc::driver::result::device::get_count().unwrap() as usize)
.map(|id| CudaDevice::new(id))
.map(CudaDevice::new)
.collect()
}
}

View File

@ -1,6 +1,7 @@
use crate::NdArrayTensor;
use crate::{element::FloatNdArrayElement, PrecisionBridge};
use alloc::string::String;
use alloc::{vec, vec::Vec};
use burn_common::stub::Mutex;
use burn_tensor::backend::{Backend, DeviceId, DeviceOps};
use core::marker::PhantomData;

View File

@ -135,8 +135,7 @@ impl<E: TchElement> Backend for LibTorch<E> {
let mut devices = vec![LibTorchDevice::Cpu];
if tch::utils::has_cuda() {
devices
.extend((0..tch::Cuda::device_count() as usize).map(|id| LibTorchDevice::Cuda(id)));
devices.extend((0..tch::Cuda::device_count() as usize).map(LibTorchDevice::Cuda));
}
if tch::utils::has_mps() {