Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

sensitivity of sum with dims has trailing singlton dimension #191

Open
oxinabox opened this issue Sep 18, 2020 · 1 comment
Open

sensitivity of sum with dims has trailing singlton dimension #191

oxinabox opened this issue Sep 18, 2020 · 1 comment

Comments

@oxinabox
Copy link
Member

oxinabox commented Sep 18, 2020

I don't know if this was introduced in #123 or merely uncovered and tested for.
But the tests in #123 are wrong AFAICT.

Consider:

julia> z = [1.0, 2.0, 3.0];

julia> size(z)
(3,)

julia> z̄, = (x->sum(sum(x'; dims=1)))(z)
([1.0; 1.0; 1.0],)

julia> size(z̄)
(3, 1)

it is an intrinstict truth of reverse mode AD that the structure of z and of must be the same.

@oxinabox
Copy link
Member Author

I can't work out the true cause, but this seems to be fixed in ChainRules and will be closed by #189

oxinabox added a commit that referenced this issue Sep 18, 2020
oxinabox added a commit that referenced this issue Oct 21, 2020
oxinabox added a commit that referenced this issue Oct 21, 2020
oxinabox added a commit that referenced this issue Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant