Skip to content

Commit a51d109

Browse files
committed
Jump tables > branches
1 parent 43f6feb commit a51d109

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/engine/engine.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ pub const BinaryType = enum {
4040
};
4141

4242
pub const Scalar = @import("scalar.zig").Scalar;
43-
// pub const Tensor = @import("tensor.zig").Tensor;
43+
pub const Tensor = @import("tensor.zig").Tensor;

src/engine/scalar.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ const engine = @import("engine.zig");
2626
/// - Softmax
2727
pub fn Scalar(comptime T: type) type {
2828
// Check that T is a valid type
29-
if (@typeInfo(T) != .int and @typeInfo(T) != .float) {
30-
@compileError("Expected @int or @float type, got: " ++ @typeName(T));
29+
switch (@typeInfo(T)) {
30+
.int, .comptime_int, .float, .comptime_float => {},
31+
else => @compileError("Expected @int or @float type, got: " ++ @typeName(T)),
3132
}
3233

3334
return struct {

0 commit comments

Comments
 (0)