Skip to content

Commit

Permalink
Explicitly export "struct" from module "flax".
Browse files Browse the repository at this point in the history
This allows the following:
```
import flax

@flax.struct.dataclass
class C: ...
```

The current usages of the above pattern in flax only work
accidentally because there already are imports for "flax.struct"
in other files.

See also https://docs.python.org/3/reference/simple_stmts.html#the-import-statement

PiperOrigin-RevId: 552452298
  • Loading branch information
Flax Team committed Aug 9, 2023
1 parent a7bb19c commit bb1902b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from . import jax_utils
from . import linen
from . import serialization
from . import struct
from . import traverse_util

# DO NOT REMOVE - Marker for internal deprecated API.
Expand Down

0 comments on commit bb1902b

Please sign in to comment.