aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/java/src/main/java/org/tensorflow/Output.java
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/java/src/main/java/org/tensorflow/Output.java')
-rw-r--r--tensorflow/java/src/main/java/org/tensorflow/Output.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/tensorflow/java/src/main/java/org/tensorflow/Output.java b/tensorflow/java/src/main/java/org/tensorflow/Output.java
index ab128c2b30..2e3f8d4eac 100644
--- a/tensorflow/java/src/main/java/org/tensorflow/Output.java
+++ b/tensorflow/java/src/main/java/org/tensorflow/Output.java
@@ -20,8 +20,11 @@ package org.tensorflow;
*
* <p>An Output is a symbolic handle to a tensor. The value of the Tensor is computed by executing
* the {@link Operation} in a {@link Session}.
+ *
+ * <p>By implementing the {@link Input} interface, instances of this class could also be passed
+ * directly in input to an operation.
*/
-public final class Output {
+public final class Output implements Input {
/** Handle to the idx-th output of the Operation {@code op}. */
public Output(Operation op, int idx) {
@@ -49,6 +52,11 @@ public final class Output {
return operation.dtype(index);
}
+ @Override
+ public Output asOutput() {
+ return this;
+ }
+
private final Operation operation;
private final int index;
}