zml: initialize Tensor.min and Tensor.max reductions with proper extreme values to ensure correct results

This commit is contained in:
Tarry Singh 2023-02-10 12:28:41 +00:00
parent be6328813d
commit 934acb35a8

View File

@ -2257,7 +2257,7 @@ pub const Tensor = struct {
} }
}.cmp, }.cmp,
self, self,
Tensor.scalar(0, self.dtype()), Tensor.constant(&.{}, self.dtype().minValue()),
&.{a}, &.{a},
); );
} }
@ -2272,7 +2272,7 @@ pub const Tensor = struct {
} }
}.cmp, }.cmp,
self, self,
Tensor.scalar(0, self.dtype()), Tensor.constant(&.{}, self.dtype().maxValue()),
&.{a}, &.{a},
); );
} }