According to the docs (I'm using v0.5.4), float4_e2m1fn does not support Inf values, and the following
jnp.astype(jnp.inf, jnp.float4_e2m1fn)
produces, as expected, the rounded-down value Array(6, dtype=float4_e2m1fn).
However, if I feed this value to jnp.isposinf, e.g. as a test whether a number format supports +Inf values, i.e.
jnp.isposinf(jnp.astype(jnp.inf, jnp.float4_e2m1fn))
I get the following output:
which is wrong.
As a workaround, is there any other way to programmatically figure out if a jnp.dtype can represent non-finite values such as Inf or NaN?
Cheers, Pedro
According to the docs (I'm using v0.5.4),
float4_e2m1fndoes not supportInfvalues, and the followingproduces, as expected, the rounded-down value
Array(6, dtype=float4_e2m1fn).However, if I feed this value to
jnp.isposinf, e.g. as a test whether a number format supports+Infvalues, i.e.I get the following output:
which is wrong.
As a workaround, is there any other way to programmatically figure out if a
jnp.dtypecan represent non-finite values such asInforNaN?Cheers, Pedro