code: public synchronized INDArray output(INDArray input, boolean train, INDArray featuresMask, INDArray labelsMask, MemoryWorkspace outputWorkspace) {
          try {
              return outputOfLayerDetached(train, FwdPassType.STANDARD, layers.length - 1, input, featuresMask, labelsMask, outputWorkspace);
          } catch (OutOfMemoryError e) {
              CrashReportingUtil.writeMemoryCrashDump(this, e);
              throw e;
          }
      }
docs: Get the network output, which is optionally placed in the specified memory workspace.<br>
  If no memory workspace is provided, the output will be detached (not in any workspace).<br>
  If a memory workspace is provided, the output activation array (i.e., the INDArray returned by this method)
  will be placed in the specified workspace. This workspace must be opened by the user before calling this method -
  and the user is responsible for (a) closing this workspace, and (b) ensuring the output array is not used out
  of scope (i.e., not used after closing the workspace to which it belongs - as this is likely to cause either
  an exception when used, or a crash).
  
  @param input           Input to the network
  @param train           True for train, false otherwise
  @param outputWorkspace May be null. If not null: the workspace MUST be opened before calling this method.
  @return The output/activations from the network (either detached or in the specified workspace if provided)