code: public synchronized <T> T output(@NonNull INDArray inputs, INDArray inputMasks, INDArray labelMasks, @NonNull OutputAdapter<T> outputAdapter) {
          try (val ws = Nd4j.getWorkspaceManager().getAndActivateWorkspace(WS_ALL_LAYERS_ACT_CONFIG, WS_OUTPUT_MEM)) {
              if (outputAdapter instanceof ModelAdapter)
                  return ((ModelAdapter<T>) outputAdapter).apply(this, new INDArray[]{inputs}, new INDArray[]{ inputMasks}, new INDArray[]{labelMasks});
              else
                  return outputAdapter.apply(output(inputs, false, inputMasks, labelMasks, ws));
          }
      }
docs: This method uses provided OutputAdapter to return custom object built from INDArray
  
  PLEASE NOTE: This method uses dedicated Workspace for output generation to avoid redundant allocations
  
  @param inputs Input arrays to the netwonk
  @param inputMasks Optional input mask arrays (may be null)
  @param labelMasks Optional label mask arrays (may be null
  @param outputAdapter OutputAdapter<T> instance
  @param <T> T extends Object
  @return T instance produced by OutputAdapter