diff --git a/crates/ml-core/src/cuda_autograd/gpu_tensor.rs b/crates/ml-core/src/cuda_autograd/gpu_tensor.rs index 34af82c82..1a208d374 100644 --- a/crates/ml-core/src/cuda_autograd/gpu_tensor.rs +++ b/crates/ml-core/src/cuda_autograd/gpu_tensor.rs @@ -34,19 +34,19 @@ fn raw_ptr_mut(slice: &mut CudaSlice, stream: &CudaStream) -> u64 { /// Helper trait for scalar values that can be converted to f32. pub trait ScalarValue { - fn as_f32(self) -> f32; + fn to_f32_scalar(self) -> f32; } impl ScalarValue for f32 { - fn as_f32(self) -> f32 { self } + fn to_f32_scalar(self) -> f32 { self } } impl ScalarValue for f64 { - fn as_f32(self) -> f32 { self as f32 } + fn to_f32_scalar(self) -> f32 { self as f32 } } impl ScalarValue for &[f32] { - fn as_f32(self) -> f32 { self.first().copied().unwrap_or(0.0) } + fn to_f32_scalar(self) -> f32 { self.first().copied().unwrap_or(0.0) } } /// A GPU-resident f32 tensor with shape information.