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.