mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-10-03 12:30:39 +08:00
Some improvements (#77)
* Various improvements. - Added support for functions in symbolic dimensions, e.g. "min(foo,bar)", which were previously disallowed due to the presence of a comma. (#51) - Added support for adding ignored names to dimensions, e.g. "cols=4". (#76) * Now works with Python 3.10 A | B union types.
This commit is contained in:
1 parent
158b8b8f0c
commit
c92b0d0ab1
4 files changed
+68
-12
No files matched your search
@@ -17,6 +17,7 @@ In addition some modifiers can be applied:
|
||||
- Prepend `*` to a dimension to indicate that it can match multiple axes, e.g. `"*batch c h w"` will match zero or more batch axes.
|
||||
- Prepend `#` to a dimension to indicate that it can be that size *or* equal to one -- i.e. broadcasting is acceptable, e.g. `def add(x: Float[Array, "#foo"], y: Float[Array, "#foo"]) -> Float[Array, "#foo"]`.
|
||||
- Prepend `_` to a dimension to disable any runtime checking of that dimension (so that it can be used just as documentation). This can also be used as just `_` on its own: e.g. `"b c _ _"`.
|
||||
- Documentation-only names (i.e. they're ignored by jaxtyping) can be handled by prepending a name followed by `=` e.g. `Float[Array, "rows=4 cols=3"]`.
|
||||
|
||||
When using multiple modifiers, their order does not matter.
|
||||
|
||||
|
||||
Reference in new issue
Block a user