Skip to content

NullPointerException when calling matrixDiagV3 #406

Closed
@frankfliu

Description

@frankfliu

The following code works fine with 0.3.1, but now I get NPE in 0.4.0:

        EagerSession eagerSession = EagerSession.options().async(true).build();
        Ops tf = Ops.create(eagerSession);
        Operand<TFloat32> diagonal = tf.fill(tf.constant(new long[]{2}), tf.constant(1f));
        Operand<TFloat32> value = tf.fill(tf.constant(new long[]{1}), tf.constant(0f));

        Operand<TFloat32> output =
                tf.linalg.matrixDiagV3(
                        diagonal, tf.constant(0), tf.constant(2), tf.constant(2), value);
        Tensor tensor = output.asTensor(); // exception here

I got exception on both macOS and Linux.

java.lang.NullPointerException
	at org.tensorflow.EagerOperation.resolveTensorHandle(EagerOperation.java:193)
	at org.tensorflow.EagerOperation.resolveTensor(EagerOperation.java:166)
	at org.tensorflow.EagerOperation.tensor(EagerOperation.java:152)
	at org.tensorflow.Output.asTensor(Output.java:97)
	at org.tensorflow.Operand.asTensor(Operand.java:65)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions