code: public INDArray[] output(INDArray[] input, INDArray[] inputMasks){
          Nd4j.getExecutioner().commit(); //Commit before passing input to other thread
  
          // basically, depending on model type we either throw stuff to specific model, or wait for batch
          BasicInferenceObserver observer = new BasicInferenceObserver();
          InferenceObservable observable;
  
          if (inferenceMode == InferenceMode.SEQUENTIAL) {
              observable = new BasicInferenceObservable(input, inputMasks);
              observable.addObserver(observer);
              try {
                  observables.put(observable);
              } catch (InterruptedException e) {
                  Thread.currentThread().interrupt();
                  throw new RuntimeException(e);
              }
          } else {
              observable = provider.setInput(observer, input, inputMasks);
          }
  
          try {
              // submit query to processing
              // and block until Observable returns
              //observer.wait();
  
              observer.waitTillDone();
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
  
          return observable.getOutput();
      }
docs: Generate predictions/outputs from the network, optionally using input masks for predictions
  
  @param input      Input to the network
  @param inputMasks Input masks for the network. May be null.
  @return Output from the network