@Override
  public List<Input<int[][]>> divideData(int num) {
    if (this.data == null) {
      return null;
    } else {
      var divisions = makeDivisions(this.data, num);
      var result = new ArrayList<Input<int[][]>>(num);
      var rowsDone = 0; //number of rows divided so far
      for (var i = 0; i < num; i++) {
        var rows = divisions[i];
        if (rows != 0) {
          var divided = new int[rows][this.data[0].length];
          System.arraycopy(this.data, rowsDone, divided, 0, rows);
          rowsDone += rows;
          var dividedInput = new ArrayInput(divided);
          result.add(dividedInput);
        } else {
          break; //rest of divisions will also be 0
        }
      }
      return result;
    }
  }
@Test
  void divideDataTest() {
    var rows = 10;
    var columns = 10;
    var inputMatrix = new int[rows][columns];
    var rand = new Random();
    for (var i = 0; i < rows; i++) {
      for (var j = 0; j < columns; j++) {
        inputMatrix[i][j] = rand.nextInt(10);
      }
    }
    var i = new ArrayInput(inputMatrix);
    var table = i.divideData(4);
    var division1 = new int[][]{inputMatrix[0], inputMatrix[1], inputMatrix[2]};
    var division2 = new int[][]{inputMatrix[3], inputMatrix[4], inputMatrix[5]};
    var division3 = new int[][]{inputMatrix[6], inputMatrix[7]};
    var division4 = new int[][]{inputMatrix[8], inputMatrix[9]};
    assertTrue(matricesSame(table.get(0).data, division1)
        && matricesSame(table.get(1).data, division2)
        && matricesSame(table.get(2).data, division3)
        && matricesSame(table.get(3).data, division4));
  }