code: public static String base64String(INDArray arr) throws IOException {
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          DataOutputStream dos = new DataOutputStream(bos);
          Nd4j.write(arr, dos);
          String base64 = Base64.encodeBase64String(bos.toByteArray());
          return base64;
      }
docs: Returns an ndarray
  as base 64
  @param arr the array to write
  @return the base 64 representation of the binary
  ndarray
  @throws IOException