Working basic eq between TensorAlloc
This commit is contained in:
+1019
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ pub fn Tensor(
|
||||
pub const total: comptime_int = _total;
|
||||
pub const strides_arr: [shape_.len]comptime_int = _strides;
|
||||
pub const ISTENSOR = true;
|
||||
pub const TENSORSTATIC = true;
|
||||
pub const TENSORKIND: sh.TensorKind = .static;
|
||||
|
||||
/// Convert N-D coords (row-major) to flat index — fully comptime.
|
||||
/// Usage: Tensor.idx(.{row, col})
|
||||
@@ -53,7 +53,7 @@ pub fn Tensor(
|
||||
}
|
||||
|
||||
/// Broadcast a single value across all elements.
|
||||
pub inline fn splat(v: T) Self {
|
||||
pub fn splat(v: T) Self {
|
||||
return .{ .data = @splat(v) };
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ const UnitScale = Scales.UnitScale;
|
||||
const Dimensions = @import("Dimensions.zig");
|
||||
const Dimension = Dimensions.Dimension;
|
||||
|
||||
pub const TensorKind = enum { static, alloc, gpu };
|
||||
|
||||
pub fn isTensor(comptime T: type) bool {
|
||||
return comptime @typeInfo(T) == .@"struct" and @hasDecl(T, "ISTENSOR");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
test {
|
||||
_ = @import("TensorStatic.zig");
|
||||
_ = @import("TensorAlloc.zig");
|
||||
_ = @import("Dimensions.zig");
|
||||
_ = @import("Scales.zig");
|
||||
_ = @import("Base.zig");
|
||||
|
||||
Reference in New Issue
Block a user