Skip to content

Commit

Permalink
export alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur-Galstyan committed Mar 3, 2024
1 parent c7cd827 commit 0ddab21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 3 additions & 0 deletions jaxonloader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from jaxonloader._datasets import * # noqa
from jaxonloader.dataloader import JaxonDataLoader, make # noqa
import equinox as eqx
from jaxtyping import Array
from collections.abc import Callable

Index = eqx.nn.State
JITJaxonDataLoader = Callable[[eqx.nn.State], tuple[Array, eqx.nn.State, bool]]
8 changes: 2 additions & 6 deletions jaxonloader/dataloader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from collections.abc import Callable

import equinox as eqx
import jax
import jax.numpy as jnp
from jaxtyping import Array, PRNGKeyArray

from jaxonloader import JITJaxonDataLoader
from jaxonloader.dataset import JaxonDataset


Expand Down Expand Up @@ -78,10 +77,7 @@ def make(
drop_last: bool = False,
key: PRNGKeyArray | None = None,
jit: bool = True,
) -> (
tuple[Callable[[eqx.nn.State], tuple[Array, eqx.nn.State, bool]], eqx.nn.State]
| tuple[JaxonDataLoader, eqx.nn.State]
):
) -> tuple[JITJaxonDataLoader, eqx.nn.State] | tuple[JaxonDataLoader, eqx.nn.State]:
dataloader, index = eqx.nn.make_with_state(JaxonDataLoader)(
dataset, batch_size, shuffle, drop_last, key=key
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "jaxonloader"
version = "0.2.1"
version = "0.2.2"
description = "A dataloader, but for JAX"
readme = "README.md"
requires-python ="~=3.10"
Expand Down

0 comments on commit 0ddab21

Please sign in to comment.