diff --git a/zml/tensor.zig b/zml/tensor.zig index 23ab003b..f2e37497 100644 --- a/zml/tensor.zig +++ b/zml/tensor.zig @@ -2419,6 +2419,10 @@ pub const Tensor = struct { /// of the operator which is backend specific. update_fn: *const fn (Tensor, Tensor) Tensor = increment, + pub fn maximum(old_value: Tensor, new_value: Tensor) Tensor { + return old_value.maximum(new_value.convert(old_value.dtype())); + } + pub fn increment(old_value: Tensor, new_value: Tensor) Tensor { return old_value.add(new_value.convert(old_value.dtype())); }