Skip to content

Commit

Permalink
Fix dtype for bool
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Nov 24, 2023
1 parent b120e4d commit f0f4086
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phiml/backend/_numpy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ def ifft(self, k, axes: Union[tuple, list]):
return np.fft.ifftn(k, axes=axes).astype(k.dtype)

def dtype(self, array) -> DType:
if isinstance(array, bool):
return DType(bool)
if isinstance(array, int):
return DType(int, 32)
if isinstance(array, float):
Expand Down
2 changes: 2 additions & 0 deletions phiml/backend/jax/_jax_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ def ifft(self, k, axes: Union[tuple, list]):
return jnp.fft.ifftn(k, axes=axes).astype(k.dtype)

def dtype(self, array) -> DType:
if isinstance(array, bool):
return DType(bool)
if isinstance(array, int):
return DType(int, 32)
if isinstance(array, float):
Expand Down

0 comments on commit f0f4086

Please sign in to comment.