Fix TensorAlloc copy that was copying the ptr
This commit is contained in:
parent
9ac3d4d699
commit
22ffd4fc64
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user