in ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java [107:135]
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DoubleDataBuffer)) {
return super.equals(obj);
}
DoubleDataBuffer other = (DoubleDataBuffer)obj;
if (size() != other.size()) {
return false;
}
return other.accept(new DataStorageVisitor<Boolean>() {
@Override
public Boolean visit(DoubleBuffer buffer) {
return buf.equals(buffer);
}
@Override
public Boolean fallback() {
for (int idx = 0; idx < size(); ++idx) {
if (other.getDouble(idx) != getDouble(idx)) {
return false;
}
}
return true;
}
});
}