Skip to content

Commit

Permalink
bugfix of the bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
flaport committed Nov 17, 2023
1 parent a14fe68 commit 6663943
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fdtd/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ class Backend:
def __repr__(self):
return self.__class__.__name__

@staticmethod
def is_complex(x):
"""check if an object is a `ComplexFloat`"""
import torch
import numpy as np

return (
isinstance(x, complex)
or (isinstance(x, np.ndarray) and x.dtype in (np.complex64, np.complex128))
Expand Down

0 comments on commit 6663943

Please sign in to comment.