We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@fastmath maximum
julia> using Zygote, BenchmarkTools julia> @macroexpand1 @fastmath maximum(x) # this is new :(Base.FastMath.maximum_fast(x)) julia> VERSION v"1.10.0-DEV.421" julia> gradient(x -> sum(maximum(x; dims=1)), [1,3,2]) ([0.0, 1.0, 0.0],) julia> @fastmath gradient(x -> sum(maximum(x; dims=1)), [1,3,2]) ERROR: Mutating arrays is not supported -- called setindex!(Vector{Int64}, ...) julia> @btime gradient(x -> maximum(x), $([1,3,2])) min 1.113 μs, mean 1.214 μs (15 allocations, 528 bytes) ([0.0, 1.0, 0.0],) julia> @btime @fastmath gradient(x -> maximum(x), $([1,3,2])) # also misses the rule min 28.541 μs, mean 29.743 μs (159 allocations, 5.94 KiB) ([0.0, 1.0, 0.0],)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: