cgarciae / treex

A Pytree Module system for Deep Learning in JAX
https://cgarciae.github.io/treex/
MIT License
214 stars 17 forks source link

Don't allow TreeParts inside generics #6

Closed cgarciae closed 3 years ago

cgarciae commented 3 years ago

Allowing TreeParts inside generics can be confusing, the annotation

Tuple[bool, TreePart[bool]]

can lead to the sensation that the first element is static and the second dynamic. The solution would be to yield an error in this case and the user would just do this

TreePart[Tuple[bool, bool]]
cgarciae commented 3 years ago

Part of #5