code: private static void getSizeMultiDimensionalArray(JsonArray jsonArray, List<Integer> dimensions) {
          Iterator<JsonElement> iterator = jsonArray.iterator();
  
          if (iterator.hasNext()) {
              JsonElement jsonElement = iterator.next();
              if (jsonElement.isJsonArray()) {
                  JsonArray shapeArray = jsonElement.getAsJsonArray();
                  dimensions.add(shapeArray.size());
                  getSizeMultiDimensionalArray(shapeArray, dimensions);
              }
          }
      }
docs: /*
  The below method works under the following assumption
  which is an INDArray can not have a row such as [ 1 , 2, [3, 4] ]
  and either all elements of an INDArray are either INDArrays themselves or scalars.
  So if that is the case, then it suffices to only check the first element of each JsonArray
  to see if that first element is itself an JsonArray. If it is an array, then we must check
  the first element of that array to see if it's a scalar or array.