Open rjdw opened 2 months ago
I think the default dtype is complex64
and not complex128
. Can you try using all complex64
and see if it works?
Hi, sorry for late response.
I tried to use all complex64
, but the same casting error occurs.
I've edited the above MRE to reflect this.
Using example from Documentation Example
Model after initialization correctly takes complex input and outputs complex.
However, during training warning,
You are casting an input of type complex64 to an incompatible dtype float32. This will discard the imaginary part and may not be what you intended.
During training, model is unable to output complex value. Output contains real part only.
I am unable to determine the origin of this casting error.
As per TF 2.16 Incompatability I am using:
MWE:
(TensorShape([1, 8, 148]), tf.complex64)
(tf.complex64, <tf.Tensor: shape=(1, 1), dtype=complex64, numpy=array([[1.0031033+0.26049298j]], dtype=complex64)>)
(dtype('float32'), dtype('float32'))
First training batch: phase value is already 0. No valid complex value is being outputted. There is a float that is being cast back into complex. The complex output has no imag part.
Edit: Changed dtype from
complex128
tocomplex64
. Result is same casting error.