Skip to content

Commit 8417ab2

Browse files
committed
Fix equality check and star import
1 parent dac3139 commit 8417ab2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public NdArraySequence<U> elements(int dimensionIdx) {
5454

5555
@Override
5656
public U withShape(Shape shape) {
57-
if (shape == this.shape()) {
57+
if (shape.equals(this.shape())) {
5858
return (U)this;
5959
}
6060
if (shape == null || shape.isUnknown() || shape.size() != this.shape().size()) {

ndarray/src/test/java/org/tensorflow/ndarray/SparseNdArrayTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
import org.tensorflow.ndarray.impl.sparse.LongSparseNdArray;
2424
import org.tensorflow.ndarray.impl.sparse.ShortSparseNdArray;
2525

26-
import static org.junit.jupiter.api.Assertions.*;
26+
import static org.junit.jupiter.api.Assertions.assertEquals;
27+
import static org.junit.jupiter.api.Assertions.assertFalse;
28+
import static org.junit.jupiter.api.Assertions.assertThrows;
29+
import static org.junit.jupiter.api.Assertions.assertTrue;
2730

2831
public class SparseNdArrayTest {
2932
long[][] indicesArray = {{0, 0}, {1, 2}, {2, 3}};

0 commit comments

Comments
 (0)