Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Check null before equality
  • Loading branch information
karllessard committed Feb 18, 2024
commit b650c3729a35a9b08b078a9fa6967dc2314267bb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public NdArraySequence<U> elements(int dimensionIdx) {

@Override
public U withShape(Shape shape) {
if (shape.equals(this.shape())) {
return (U)this;
}
if (shape == null || shape.isUnknown() || shape.size() != this.shape().size()) {
throw new IllegalArgumentException("Shape " + shape + " cannot be used to reshape ndarray of shape " + this.shape());
}
if (shape.equals(this.shape())) {
return (U)this;
}
return instantiateView(buffer(), DimensionalSpace.create(shape));
}

Expand Down