From 0b3a9aaa0b5fa3027a3b99a13c2f9c1c1741fa3e Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Thu, 2 Oct 2025 08:06:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Wave=2037-1:=20Fix=20CUDA=20exam?= =?UTF-8?q?ple=20compilation=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ml/examples/cuda_test.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ml/examples/cuda_test.rs b/ml/examples/cuda_test.rs index de8dbd391..2fb3cfa91 100644 --- a/ml/examples/cuda_test.rs +++ b/ml/examples/cuda_test.rs @@ -4,7 +4,7 @@ //! can successfully create tensors and perform basic operations. use candle_core::{Device, Tensor}; -use candle_nn::{Linear, Module, VarBuilder, VarMap}; +use candle_nn::{linear, Module, VarBuilder, VarMap}; /// Test basic CUDA tensor operations pub fn test_cuda_basic() -> Result<(), Box> { @@ -39,14 +39,14 @@ pub fn test_cuda_neural_network() -> Result<(), Box> { match Device::new_cuda(0) { Ok(device) => { - let mut varmap = VarMap::new(); + let varmap = VarMap::new(); let vs = VarBuilder::from_varmap(&varmap, candle_core::DType::F32, &device); // Create a simple linear layer - let linear = Linear::new(10, 5, vs.pp("linear"))?; + let linear_layer = linear(10, 5, vs.pp("linear"))?; let input = Tensor::randn(0f32, 1.0, (1, 10), &device)?; - let output = linear.forward(&input)?; + let output = linear_layer.forward(&input)?; println!( "✅ Neural network forward pass successful: {:?}", output.shape()