docs: public long writeScalarEvent(String name, long time, int iteration, int epoch, Number scalar) throws IOException {
          //TODO add support for plugin, variable and frame/iter
          Preconditions.checkState(indexNameMap.containsKey(name), "Name \"%s\" not yet registered", name);
          int idx = indexNameMap.get(name);
          FlatBufferBuilder fbb = new FlatBufferBuilder(0);
          int offset = UIEvent.createUIEvent(fbb, UIEventType.SCALAR, idx, time, iteration, epoch, (short)-1, 0, 0);
          fbb.finish(offset);
  
          FlatBufferBuilder fbb2 = new FlatBufferBuilder(0);
          int offset2 = Nd4j.scalar(scalar).toFlatArray(fbb2);
          fbb2.finish(offset2);
  
          return append(fbb, fbb2);
      }