Skip to content

Commit a90a8da

Browse files
author
Joe Petviashvili
committed
add clamp with numbers
1 parent 3f94968 commit a90a8da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/array.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,7 @@ end
345345
for op in (:sort, :cumsum, :cumprod, :cummin, :cummax)
346346
@eval $op(a::AFArray{T,N}; dims=1) where {T,N} = $op(a, dims)
347347
end
348+
349+
function clamp(_in::AFArray{T1,N1},lo::N2,hi::N2) where {T1,N1,N2}
350+
return clamp(_in, constant(lo, size(_in)), constant(hi, size(_in)))
351+
end

0 commit comments

Comments
 (0)