Skip to content

Commit bff7bce

Browse files
author
“thucydides”
committed
fix: Resolve duplicate definitions and exhaustive match errors in core
1 parent 8b54794 commit bff7bce

25 files changed

Lines changed: 13 additions & 18 deletions

rustorch-core/src/storage.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ impl Storage {
124124
#[cfg(feature = "vulkan_backend")]
125125
StorageImpl::Vulkan(buf) => buf.len() as usize,
126126
}
127+
}#[cfg(feature = "wgpu_backend")]
128+
StorageImpl::Wgpu(_, size) => *size,
129+
#[cfg(feature = "vulkan_backend")]
130+
StorageImpl::Vulkan(buf) => buf.len() as usize,
131+
}
127132
}
128133

129134
pub fn is_empty(&self) -> bool {
@@ -186,6 +191,14 @@ impl fmt::Debug for Storage {
186191
StorageImpl::CudaStub => {
187192
write!(f, "CudaStorageStub({:?})", self.device)
188193
}
194+
#[cfg(feature = "wgpu_backend")]
195+
StorageImpl::Wgpu(_, size) => {
196+
write!(f, "WgpuStorage({:?}, size={})", self.device, size)
197+
}
198+
#[cfg(feature = "vulkan_backend")]
199+
StorageImpl::Vulkan(buf) => {
200+
write!(f, "VulkanStorage({:?}, size={})", self.device, buf.len())
201+
}
189202
}
190203
}
191204
}

rustorch-core/src/tensor.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ impl Tensor {
134134
self.inner.requires_grad
135135
}
136136

137-
pub fn shape(&self) -> &[usize] {
138-
&self.inner.shape
139-
}
140-
141137
pub fn data(&self) -> RwLockReadGuard<'_, Vec<f32>> {
142138
self.inner.storage.data()
143139
}
@@ -342,10 +338,6 @@ impl Tensor {
342338
}
343339
}
344340

345-
pub fn strides(&self) -> &[usize] {
346-
&self.inner.strides
347-
}
348-
349341
pub fn reshape(&self, new_shape: &[usize]) -> Tensor {
350342
let size: usize = self.shape().iter().product();
351343
let new_size: usize = new_shape.iter().product();

target/debug/.fingerprint/zerocopy-846809d6bec8a01a/build-script-build-script-build

Lines changed: 0 additions & 1 deletion
This file was deleted.

target/debug/.fingerprint/zerocopy-846809d6bec8a01a/build-script-build-script-build.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.

target/debug/.fingerprint/zerocopy-846809d6bec8a01a/invoked.timestamp

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)