Skip to content

Commit 1556555

Browse files
authored
[jax] Relax einsum checks for >=0.8.2 and update docs (#55)
* Remove non-deterministic assertion in _einops.py and update README for ecosystem terminology * Update version to 0.1.3 and adjust version_info to reflect new format * Update changelog for version 0.1.3 with compatibility note for jax
1 parent b78bf15 commit 1556555

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

brainunit/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The official documentation of BrainUnit is hosted on Read the Docs: [https://bra
4848

4949
## Features
5050

51-
`brainunit` can be seamlessly integrated into every aspect of our [brain dynamics programming ecosystem](https://ecosystem-for-brain-dynamics.readthedocs.io/), such as, the checkpointing of [braintools](https://github.com/chaobrain/braintools), the event-driven operators in [brainevent](https://github.com/chaobrain/brainevent), the state-based JIT compilation in [brainstate](https://github.com/chaobrain/brainstate), online learning rules in [brainscale](https://github.com/chaobrain/brainscale), or event more.
51+
`brainunit` can be seamlessly integrated into every aspect of our [brain modeling ecosystem](https://brainmodeling.readthedocs.io/), such as, the checkpointing of [braintools](https://github.com/chaobrain/braintools), the event-driven operators in [brainevent](https://github.com/chaobrain/brainevent), the state-based JIT compilation in [brainstate](https://github.com/chaobrain/brainstate), online learning rules in [brainscale](https://github.com/chaobrain/brainscale), or event more.
5252

5353
A quick example for this kind of integration:
5454

@@ -128,6 +128,6 @@ If you use `brainunit` in your research, please consider citing the following pa
128128

129129

130130

131-
## See also the BDP ecosystem
131+
## See also the ecosystem
132132

133-
We are building the [brain dynamics programming (BDP) ecosystem](https://ecosystem-for-brain-dynamics.readthedocs.io/). [brainunit](https://github.com/chaobrain/brainunit) has been deeply integrated into our BDP ecosystem.
133+
``brainunit`` is one part of our [brain modeling ecosystem](https://brainmodeling.readthedocs.io/).

brainunit/brainunit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import saiunit
1818

1919
__version__ = saiunit.__version__
20-
__version_info__ = saiunit.__version_info__
20+
__version_info__ = tuple(map(int, __version__.split(".")))
2121

2222
from . import autograd
2323
from . import constants

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release Notes
22

3+
## Version 0.1.3
4+
5+
- Compatible with `jax>=0.8.2`
6+
7+
38
## Version 0.1.2
49

510
- Renamed ``CustomArray.value`` to ``CustomArray.data`` for API consistency

saiunit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414
# ==============================================================================
1515

16-
__version__ = "0.1.2"
17-
__version_info__ = (0, 1, 2)
16+
__version__ = "0.1.3"
17+
__version_info__ = tuple(map(int, __version__.split(".")))
1818

1919
from . import _matplotlib_compat
2020
from . import autograd

saiunit/math/_einops.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -938,16 +938,6 @@ def _einsum(
938938

939939
lhs_batch, rhs_batch = unzip2((lhs_names.find(n), rhs_names.find(n)) for n in batch_names)
940940

941-
# NOTE: this can fail non-deterministically in python3, maybe
942-
# due to opt_einsum
943-
assert jax.config.jax_dynamic_shapes or all(
944-
name in lhs_names and name in rhs_names and
945-
lhs.shape[lhs_names.index(name)] == rhs.shape[rhs_names.index(name)]
946-
for name in contracted_names), \
947-
("Incompatible reduction dimensions: "
948-
f"lhs.shape={lhs.shape} lhs_names={lhs_names} "
949-
f"rhs.shape={rhs.shape} rhs_names={rhs_names}")
950-
951941
# contract using dot_general
952942
batch_names_str = ''.join(batch_names)
953943
lhs_cont, rhs_cont = unzip2((lhs_names.index(n), rhs_names.index(n)) for n in contracted_names)

0 commit comments

Comments
 (0)