Skip to content
New issue

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

Revert LoopVectorization #226

Merged
merged 5 commits into from
Aug 1, 2020
Merged

Conversation

DhairyaLGandhi
Copy link
Member

Following discussion in FluxML/Flux.jl#1272, #224, it is best to have a better pattern to introduce vectorisation in a more formal manner.

This reverts #199 for the time being.

src/activation.jl Outdated Show resolved Hide resolved

# Provide an informative error message if activation functions are called with an array
for f in (:σ, :hardσ, :logσ, :hardtanh, :relu, :leakyrelu, :relu6, :rrelu, :elu, :gelu, :swish, :lisht, :selu, :celu, :trelu, :softsign, :softplus, :logcosh, :mish, :tanhshrink, :softshrink)
@eval $(f)(x::AbstractArray, args...) =
error("Use broadcasting (`", $(string(f)), ".(x)`) to apply activation functions to arrays.")
end

for f in (:σ, :tanh)
@eval Base.broadcasted(::typeof($f), x::Array{T, N}) where {T <: Union{Float64, Float32}, N} = vmap($f, x)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also some aggressive piracy that is good to get rid of

@DhairyaLGandhi
Copy link
Member Author

Travis still seems to add LV in the test suite. Any idea why?

@DhairyaLGandhi
Copy link
Member Author

DhairyaLGandhi commented Jul 30, 2020

Any major changes apart from conflicts needed here? I think it's good to go otherwise. cc @CarloLucibello

@CarloLucibello
Copy link
Member

ok, let's do this. Then we need some proper discussion on how to reorganize the code in JuliaML

@CarloLucibello CarloLucibello merged commit 2e1fa5f into FluxML:master Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants