Skip to content

Commit 8a58b9c

Browse files
committed
Override default Javadoc for shape()
1 parent ff45e77 commit 8a58b9c

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ default T data() {
7979
return asOutput().tensor().data();
8080
}
8181

82+
/**
83+
* Returns the (possibly partially known) shape of the tensor referred to by the {@link Output} of this operand.
84+
*/
8285
@Override
8386
default Shape shape() {
8487
return asOutput().shape();

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public Tensor<T> tensor() {
8080
return (Tensor<T>) operation.tensor(index);
8181
}
8282

83+
/**
84+
* Returns the (possibly partially known) shape of the tensor referred to by this output.
85+
*/
8386
@Override
8487
public Shape shape() {
8588
return operation.shape(index);

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ public long numBytes() {
233233
return numBytes;
234234
}
235235

236+
/** Returns the shape of this tensor. */
236237
@Override
237238
public Shape shape() {
238239
return shape;

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/nn/SigmoidCrossEntropyWithLogits.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static <T extends TNumber> Operand<T> sigmoidCrossEntropyWithLogits(
6767
throw new IllegalArgumentException(
6868
String.format(
6969
"logits and labels must have the same shape (%s vs %s)",
70-
labels.shape().toString(), logits.shape()));
70+
labels.shape(), logits.shape()));
7171
}
7272
scope = scope.withSubScope("SigmoidCrossEntropyWithLogits");
7373

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static <T extends TNumber, U extends TNumber> Operand sparseSoftmaxCrossE
9898
throw new IllegalArgumentException(
9999
String.format(
100100
"Rank mismatch: Rank of labels (received %s) should equal rank of logits minus 1 (received %s).",
101-
labelsStaticShape.toString(), logitsShape.toString()));
101+
labelsStaticShape, logitsShape));
102102
}
103103

104104
if (staticShapesFullyDefined && !labelsStaticShape.equals(logitsShortened)) {
@@ -107,7 +107,7 @@ public static <T extends TNumber, U extends TNumber> Operand sparseSoftmaxCrossE
107107
"Shape mismatch: The shape of labels (received %s) "
108108
+ "should equal the shape of logits except for the last "
109109
+ "dimension (received %s).",
110-
labelsStaticShape.toString(), logitsShape.toString()));
110+
labelsStaticShape, logitsShape));
111111
}
112112
// Check if no reshapes are required.
113113
if (logitsShape.numDimensions() == 2) {

0 commit comments

Comments
 (0)