@Override public boolean equals(INDArray a) { if (!Arrays.equals(a.getShape(), this.getShape())) return false; for (int i = 0; i < slices.length; i++) { if (!slices[i].equals(a.slice(i))) return false; } return true; }
@Override public INDArray slice(int dimension, int index) { if (dimension < 0) throw new IllegalArgumentException(ErrorMessages.invalidDimension(this, dimension)); if (dimension == 0) return slice(index); ArrayList<INDArray> al = new ArrayList<INDArray>(sliceCount()); for (INDArray s : this) { al.add(s.slice(dimension - 1, index)); } return SliceArray.create(al); }