From 22ffd4fc64778a5c381f8aa1533ad04d242d36d7 Mon Sep 17 00:00:00 2001 From: adrien Date: Wed, 27 May 2026 21:15:58 +0200 Subject: [PATCH] Fix TensorAlloc copy that was copying the ptr --- src/TensorAlloc.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TensorAlloc.zig b/src/TensorAlloc.zig index 26ada40..eec8b15 100644 --- a/src/TensorAlloc.zig +++ b/src/TensorAlloc.zig @@ -60,9 +60,9 @@ pub fn Tensor( } pub fn copy(self: *const Self, alloc: Allocator) !Self { - var new = try splat(alloc, 0); - new.data = self.data; - return new; + const vec_ptr = try alloc.create(Vec); + vec_ptr.* = self.data.*; + return .{ .data = vec_ptr }; } /// Convert N-D coords (row-major) to flat index — fully comptime.