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 {
|
pub fn copy(self: *const Self, alloc: Allocator) !Self {
|
||||||
var new = try splat(alloc, 0);
|
const vec_ptr = try alloc.create(Vec);
|
||||||
new.data = self.data;
|
vec_ptr.* = self.data.*;
|
||||||
return new;
|
return .{ .data = vec_ptr };
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert N-D coords (row-major) to flat index — fully comptime.
|
/// Convert N-D coords (row-major) to flat index — fully comptime.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user