code: @Override
      public void storeUpdate(INDArray array, int iterationNumber, int epochNumber) {
          /*
              Here we want to do 4 things:
              1) update accumulated values
              2) invoke extractor, that'll (optionally) pull all updates above threshold
              3) ???
              4) PROFIT!
           */
  
          try {
              // commit should happen in each individual thread
              Nd4j.getExecutioner().commit();
              firstOne.compareAndSet(-1L, Thread.currentThread().getId());
  
              // TODO: since we know number of elements in advance, we don't really need CopyOnWrite list here.
              candidates.add(array);
              barrier.await();
  
              if (firstOne.get() == Thread.currentThread().getId()) {
                  // if accum is null, let's just create it here
                  if (storage == null) {
                      // we don't want state array to be attached to any workspace
                      shape = array.shape();
                      ordering = array.ordering();
  
                      try (MemoryWorkspace workspace = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
                          // TODO: if p2p isn't supported, this should become HOST-only allocation
                          storage = Nd4j.create(shape, ordering);
                      }
                  }
  
  
                  // accumulate our values, a
                  //storage.addi(array);
                  Nd4j.accumulate(storage, candidates);
  
                  // we ensure storage was updated successfully
                  Nd4j.getExecutioner().commit();
  
                  // if there's something to send - send it. Skip otherwise!!!
                  if (handler.broadcastUpdates(storage, iterationNumber, epochNumber)) {
                      ownCounter.getAndIncrement();
                  }
  
                  // reset "first one" :)
                  firstOne.set(-1L);
                  candidates.clear();
              }
  
              barrier.await();
          } catch (InterruptedException e) {
              Thread.currentThread().interrupt();
              throw new RuntimeException(e);
          } catch (BrokenBarrierException e) {
              throw new RuntimeException(e);
          }
      }
docs: This method accepts updates suitable for StepFunction, and accumulates/propagates it across all workers
  
  @param array