From 5fbe3b4b1bcca05560e3692d916dbebbd52af5f5 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 31 Oct 2024 12:07:52 +0000 Subject: [PATCH 1/2] BestAvailable should be an alias --- crates/burn-tensor/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/burn-tensor/src/lib.rs b/crates/burn-tensor/src/lib.rs index 75b037972f..2692b21b49 100644 --- a/crates/burn-tensor/src/lib.rs +++ b/crates/burn-tensor/src/lib.rs @@ -65,7 +65,7 @@ mod cube_wgpu { WgpuDevice::IntegratedGpu(index) => DeviceId::new(1, *index as u32), WgpuDevice::VirtualGpu(index) => DeviceId::new(2, *index as u32), WgpuDevice::Cpu => DeviceId::new(3, 0), - WgpuDevice::BestAvailable => DeviceId::new(4, 0), + WgpuDevice::BestAvailable | WgpuDevice::DefaultDevice => DeviceId::new(4, 0), // For an existing device, use the 64 bit wgpu device ID as the burn DeviceID. // We're only storing 32 bits, so wrap the the 64 bit value to 32 bits. This // might collide - but a 1 in 4 billion chance seems ok given there's only a few @@ -73,7 +73,6 @@ mod cube_wgpu { WgpuDevice::Existing(id) => { DeviceId::new(5, (id.inner() % (u32::MAX as u64)) as u32) } - WgpuDevice::DefaultDevice => DeviceId::new(6, 0), } } } From 1113e006b78a044b9cc58d648641b3ca9f922e16 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 31 Oct 2024 12:12:48 +0000 Subject: [PATCH 2/2] Fix an old reference --- burn-book/src/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/burn-book/src/getting-started.md b/burn-book/src/getting-started.md index 5f3bfb4ba0..3f6c22d314 100644 --- a/burn-book/src/getting-started.md +++ b/burn-book/src/getting-started.md @@ -157,7 +157,7 @@ Tensor { [[3.0, 4.0], [5.0, 6.0]], shape: [2, 2], - device: BestAvailable, + device: DefaultDevice, backend: "wgpu", kind: "Float", dtype: "f32",