Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kits reloaded #1633

Merged
merged 19 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
same_as on OpaqueTensor
  • Loading branch information
mathieupoumeyrolsonos committed Jan 30, 2025
commit 6c784b397183b230dbb73653df4290342e97ebac
6 changes: 6 additions & 0 deletions metal/src/tensor/mod.rs
Original file line number Diff line number Diff line change
@@ -235,6 +235,12 @@ impl From<MetalArenaView> for MetalTensor {
}

impl OpaquePayload for MetalTensor {
fn same_as(&self, other: &dyn OpaquePayload) -> bool {
other
.downcast_ref::<Self>()
.is_some_and(|other| self.metal().gpu_address() == other.metal().gpu_address())
}

fn clarify_to_tensor(&self) -> Option<Result<Tensor>> {
Some(self.to_cpu())
}
Loading