Skip to content

Commit

Permalink
fix feature flag (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseWillden authored Jan 8, 2025
1 parent 2c7f000 commit 3b48550
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions delta/src/common/tensor_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ impl Tensor {
}

/// Creates a tensor filled with ones.
///
///
/// # Arguments
///
///
/// * `shape` - A vector representing the shape of the tensor.
///
///
/// # Returns
///
///
/// A tensor filled with ones.
pub fn ones(shape: Shape<IxDyn>, device: Device) -> Self {
Self { data: Array::ones(shape), device }
Expand Down Expand Up @@ -212,7 +212,7 @@ impl Tensor {
Device::Cpu => {
Tensor { data: self_2d.dot(&other_2d).into_dyn(), device: self.device.clone() }
}
#[cfg(feature = "metal")]
#[cfg(all(target_os = "macos", feature = "metal"))]
Device::Metal { device, queue } => tensor_matmul_metal(
&Tensor { data: self_2d.to_owned().into_dyn(), device: self.device.clone() },
&Tensor { data: other_2d.to_owned().into_dyn(), device: self.device.clone() },
Expand Down
4 changes: 2 additions & 2 deletions delta/src/neuralnet/models/sequential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use serde_json;
use crate::common::Tensor;
use crate::dataset::ImageDatasetOps;
use crate::devices::Device;
#[cfg(feature = "metal")]
#[cfg(all(target_os = "macos", feature = "metal"))]
use crate::devices::osx_metal;
use crate::losses::Loss;
use crate::neuralnet::layers::Layer;
Expand Down Expand Up @@ -483,7 +483,7 @@ impl Sequential {
pub fn use_optimized_device(&mut self) {
self.device = Some(Device::Cpu);

#[cfg(feature = "metal")]
#[cfg(all(target_os = "macos", feature = "metal"))]
{
println!("Transferring data to Metal device.");
let (metal_device, metal_queue) = osx_metal::get_device_and_queue_metal();
Expand Down

0 comments on commit 3b48550

Please sign in to comment.