I’m not familiar with PyTorch, but:
julia> clamp.(rand(10), 0.3, 0.7)
10-element Vector{Float64}:
0.7
0.3
0.7
0.3
0.4230237955951067
0.685909160414593
0.7
0.41101750524323943
0.4303566233748203
0.3
I’m not familiar with PyTorch, but:
julia> clamp.(rand(10), 0.3, 0.7)
10-element Vector{Float64}:
0.7
0.3
0.7
0.3
0.4230237955951067
0.685909160414593
0.7
0.41101750524323943
0.4303566233748203
0.3