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

[feat] Extended Type Annotations for TimeStep #25

Closed
joeryjoery opened this issue Nov 10, 2023 · 3 comments
Closed

[feat] Extended Type Annotations for TimeStep #25

joeryjoery opened this issue Nov 10, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@joeryjoery
Copy link
Owner

Extend the Type Generics for TimeStep so that one is allowed by the type-checker to create transformations of other TimeStep objects.

Example behaviour,

# Or just step: TimeStep without annotations
step: TimeStep[jax.Array] = ...

new_step: TimeStep[tuple[int]] = jax.tree_map(jnp.shape, step)

At the moment this is only possible for the Observation field.

@joeryjoery joeryjoery added the enhancement New feature or request label Nov 10, 2023
@joeryjoery
Copy link
Owner Author

This would be solved by https://peps.python.org/pep-0696/

@joeryjoery
Copy link
Owner Author

For now I will simply extend the TimeStep with Generics for all fields and bound them with their current type and the PyTree type from jaxtyping

@joeryjoery joeryjoery mentioned this issue Nov 10, 2023
Merged
@joeryjoery
Copy link
Owner Author

This problem is tracked further in #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant