-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complex Tensor Implementation Missing? #494
Comments
At the moment we don't support it, but we'd welcome contributions to add that support. It would need to build the ndarray support and add the types to this package. Complex64 is ok as that can use long as the carrier type and unpack it into two floats for computation, but Java doesn't have a 128-bit primitive type so things have to be boxed and that will cause a lot of problems. |
So in this case the FFT calculation is also not possible. Are the calculation functions in the native code available for the fft calculations? Best Regards |
We can still do FFTs and what not, and access the raw buffers, that works fine. It's just the high-level API support that isn't there. |
But in @josefwilfinger case, the only thing that matters is to map a class extending I think that could be done easily by registering a new class in the |
The error message you are getting is because the Tout parameter of the tf.dtypes.complex function expects a ComplexDataType. However, there is no such thing as a ComplexDataType in TensorFlow Java. The closest thing is the DataType enum, which has two values for complex numbers: DT_COMPLEX64 and DT_COMPLEX128. |
Hi everybody,
i am just simply trying to create a Complex object, and asking myself it is simply not implemented, because i do not find the Class-Type for complex64 or complex128for the Tout parameter for the "df.dtypes.complex" function. In line 5 i just used TFloat32 to get it compiled.
1 Graph g = new Graph();
2 Ops tf = Ops.create(g);
3 Constant r = tf.constant(Float.valueOf((float)5.0));
4 Constant i = tf.constant(Float.valueOf((float)3.0));
5 Complex c = tf.dtypes.complex(r,i, TFloat32.class);
I understand the problem, in line 5:
Exception in thread "main" org.tensorflow.exceptions.TFInvalidArgumentException: Value for attr 'Tout' of double is not in the list of allowed values: complex64, complex128
; NodeDef: {{node Complex}}; Op<name=Complex; signature=real:T, imag:T -> out:Tout; attr=T:type,default=DT_FLOAT,allowed=[DT_FLOAT, DT_DOUBLE]; attr=Tout:type,default=DT_COMPLEX64,allowed=[DT_COMPLEX64, DT_COMPLEX128]>
at org.tensorflow.internal.c_api.AbstractTF_Status.throwExceptionIfNotOK(AbstractTF_Status.java:87)
at org.tensorflow.GraphOperationBuilder.finish(GraphOperationBuilder.java:461)
at org.tensorflow.GraphOperationBuilder.build(GraphOperationBuilder.java:100)
at org.tensorflow.GraphOperationBuilder.build(GraphOperationBuilder.java:71)
at org.tensorflow.op.dtypes.Complex.create(Complex.java:95)
at org.tensorflow.op.DtypesOps.complex(DtypesOps.java:107)
at TensorflowTest.main(TensorflowTest.java:74)
But i do not find a ComplexDataType like TFLoat32
Can anyone bring light into my deepest darkness? I do not find a documentation or an example how it shall be done in java.
Best Regards
The text was updated successfully, but these errors were encountered: