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

Elementwise functions exp.(::KnetArray),tanh.(::KnetArray),sigm.(::KnetArray) returns Array instead of KnetArray #173

Closed
ekinakyurek opened this issue Oct 6, 2017 · 2 comments
Labels

Comments

@ekinakyurek
Copy link
Collaborator

ekinakyurek commented Oct 6, 2017

In julia v0.5, exp.(::KnetArray),tanh.(::KnetArray),sigm.(::KnetArray) returns Array instead of KnetArray.
Is this a deliberate decision?

julia> a
4×4 Knet.KnetArray{Float32,2}:
 0.00120054  -0.0240854  -0.0209539   0.00840658
 0.0262971    0.0353132  -0.0350228   0.0356118
 0.0319216    0.0111997   0.033148    0.0330177
 0.0382866    0.037246   -0.0201402  -0.039074

julia> exp.(a)
4×4 Array{Float32,2}:
 1.0012   0.976202  0.979264  1.00844
 1.02665  1.03594   0.965583  1.03625
 1.03244  1.01126   1.0337    1.03357
 1.03903  1.03795   0.980061  0.96168

julia> sigm.(a)
4×4 Array{Float32,2}:
 0.5003    0.493979  0.494762  0.502102
 0.506574  0.508827  0.491245  0.508902
 0.50798   0.5028    0.508286  0.508254
 0.50957   0.50931   0.494965  0.490233

julia> tanh.(a)
4×4 Array{Float32,2}:
 0.00120054  -0.0240807  -0.0209508   0.00840638
 0.026291     0.0352986  -0.0350085   0.0355968
 0.0319108    0.0111992   0.0331358   0.0330057
 0.0382679    0.0372288  -0.0201375  -0.0390542
denizyuret added a commit that referenced this issue Oct 19, 2017
…Array),sigm.(::KnetArray) returns Array instead of KnetArray #173
@denizyuret
Copy link
Owner

Fixed, please test.

@denizyuret denizyuret added the bug label Oct 19, 2017
@ekinakyurek
Copy link
Collaborator Author

Thanks, it is okey now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants