mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-09-09 11:24:55 +08:00
Add int4/uint4 support in jaxtyping. (#174)
* Add int4/uint4 support in jaxtyping. * Fix a typo and update api docs.
This commit is contained in:
committed by
Patrick Kidger
parent
1d4d40294c
commit
9beb5f2d29
@@ -67,6 +67,7 @@ def test_dtypes():
|
||||
Float64,
|
||||
Inexact,
|
||||
Int,
|
||||
Int4,
|
||||
Int8,
|
||||
Int16,
|
||||
Int32,
|
||||
@@ -74,6 +75,7 @@ def test_dtypes():
|
||||
Num,
|
||||
Shaped,
|
||||
UInt,
|
||||
UInt4,
|
||||
UInt8,
|
||||
UInt16,
|
||||
UInt32,
|
||||
@@ -125,7 +127,9 @@ def test_any_dtype(jaxtyp, typecheck, getkey):
|
||||
|
||||
g(jr.normal(getkey(), (3, 4)))
|
||||
g(jnp.array([[True, False]]))
|
||||
g(jnp.array([[1, 2], [3, 4]], dtype=jnp.int4))
|
||||
g(jnp.array([[1, 2], [3, 4]], dtype=jnp.int8))
|
||||
g(jnp.array([[1, 2], [3, 4]], dtype=jnp.uint4))
|
||||
g(jnp.array([[1, 2], [3, 4]], dtype=jnp.uint16))
|
||||
g(jr.normal(getkey(), (3, 4), dtype=jnp.complex128))
|
||||
g(jr.normal(getkey(), (3, 4), dtype=jnp.bfloat16))
|
||||
|
||||
Reference in New Issue
Block a user