Closed
Description
As the title says, tf.variable
with an initial value does not work in eager mode. I'm not sure if it is supposed to, as tf.Variable
does in the python api but apparently didn't at first. Interestingly, it's not the variable op that fails, it's the assign:
cannot compute Assign as input #0(zero-based) was expected to be a int32_ref tensor but is a int32 tensor
org.tensorflow.exceptions.TFInvalidArgumentException: cannot compute Assign as input #0(zero-based) was expected to be a int32_ref tensor but is a int32 tensor
at org.tensorflow.internal.c_api.AbstractTF_Status.throwExceptionIfNotOK(AbstractTF_Status.java:87)
at org.tensorflow.EagerOperationBuilder.execute(EagerOperationBuilder.java:273)
at org.tensorflow.EagerOperationBuilder.build(EagerOperationBuilder.java:66)
at org.tensorflow.EagerOperationBuilder.build(EagerOperationBuilder.java:55)
at org.tensorflow.op.core.Assign.create(Assign.java:97)
at org.tensorflow.op.core.Helpers.createVariableWithInit(Helpers.java:51)
at org.tensorflow.op.Ops.variable(Ops.java:7520)
Metadata
Metadata
Assignees
Labels
No labels