Skip to content

Commit

Permalink
default dtype setting
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Mar 30, 2024
1 parent e01e92c commit ff96c34
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions braincore/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,8 @@ def _get_float(precision: int):
return jnp.float32
elif precision == 16:
return jnp.bfloat16
# return np.float16
else:
raise ValueError(f'Unsupported precision: {precision}')
raise ValueError(f'Unsupported floating precision: {precision}')


@functools.lru_cache()
Expand All @@ -341,10 +340,8 @@ def _get_complex(precision: int):
return jnp.complex128
elif precision == 32:
return jnp.complex64
elif precision == 16:
return jnp.complex32
else:
raise ValueError(f'Unsupported precision: {precision}')
raise ValueError(f'Unsupported complex precision: {precision}')


def dftype() -> DTypeLike:
Expand Down

0 comments on commit ff96c34

Please sign in to comment.