Commit 06686623 authored by Reimar Leike's avatar Reimar Leike

Fixed Realizer to follow consistent real/compelx behavior

parent 8ff2b114
Pipeline #75485 failed with stages
in 3 minutes and 44 seconds
......@@ -109,7 +109,13 @@ class Realizer(EndomorphicOperator):
def apply(self, x, mode):
self._check_input(x, mode)
return x.real
if mode == self.TIMES:
if not np.issubdtype(x.dtype, np.complexfloating):
raise ValueError
return x.real
if x.dtype not in (np.float64, np.float32):
raise ValueError
return Field(x.domain, x.val.astype(np.complex128))
class Imaginizer(EndomorphicOperator):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment