mirror of https://github.com/tracel-ai/burn.git
Fix clippy
This commit is contained in:
parent
f20a4b9643
commit
64ae3d697c
|
@ -5,6 +5,7 @@ use crate::{
|
|||
tensor::AutodiffTensor,
|
||||
AutodiffBridge,
|
||||
};
|
||||
use alloc::vec::Vec;
|
||||
use burn_tensor::backend::{AutodiffBackend, Backend};
|
||||
use core::marker::PhantomData;
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue