From 934acb35a8dd18d1e42616e8f48e4a4bd9677c8d Mon Sep 17 00:00:00 2001 From: Tarry Singh Date: Fri, 10 Feb 2023 12:28:41 +0000 Subject: [PATCH] zml: initialize Tensor.min and Tensor.max reductions with proper extreme values to ensure correct results --- zml/tensor.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zml/tensor.zig b/zml/tensor.zig index 1a0bf91..80382a9 100644 --- a/zml/tensor.zig +++ b/zml/tensor.zig @@ -2257,7 +2257,7 @@ pub const Tensor = struct { } }.cmp, self, - Tensor.scalar(0, self.dtype()), + Tensor.constant(&.{}, self.dtype().minValue()), &.{a}, ); } @@ -2272,7 +2272,7 @@ pub const Tensor = struct { } }.cmp, self, - Tensor.scalar(0, self.dtype()), + Tensor.constant(&.{}, self.dtype().maxValue()), &.{a}, ); }