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

Composite clarification #221

Open
mzgubic opened this issue Sep 22, 2020 · 2 comments
Open

Composite clarification #221

mzgubic opened this issue Sep 22, 2020 · 2 comments
Labels
design Requires some desgin before changes are made documentation Improvements or additions to documentation Structural Tangent Related to the `Tangent` type for structured (composite) values

Comments

@mzgubic
Copy link
Member

mzgubic commented Sep 22, 2020

The docs say that Composite users should disregard the T parameter as it is an implementation detail.

However both ChainRules and Zygote do not always follow this recommendation.

There is a difference between the two constructors and it is not clear when to apply which one. Perhaps a comment could be added to the docs?

julia> xt = (1, 2)
(1, 2)

julia> ct1 = Composite{Any, typeof(xt)}(xt)
Composite{Any}(1, 2)

julia> ct2 = Composite{Any}(xt)
Composite{Any}((1, 2),)
@nickrobinson251 nickrobinson251 added Structural Tangent Related to the `Tangent` type for structured (composite) values design Requires some desgin before changes are made documentation Improvements or additions to documentation labels Sep 23, 2020
@mzgubic
Copy link
Member Author

mzgubic commented Sep 25, 2020

As a consequence they behave differently when splatted:

julia> println(ct1...)
12

julia> println(ct2...)
(1, 2)

@nickrobinson251
Copy link
Contributor

Xref #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Requires some desgin before changes are made documentation Improvements or additions to documentation Structural Tangent Related to the `Tangent` type for structured (composite) values
Projects
None yet
Development

No branches or pull requests

2 participants