docs: @Override
      public void reset() {
          buffer.clear();
  
          if (thread != null)
              thread.interrupt();
          try {
              // Shutdown() should be a synchronous operation since the iterator is reset after shutdown() is
              // called in AsyncLabelAwareIterator.reset().
              if (thread != null)
                  thread.join();
          } catch (InterruptedException e) {
              Thread.currentThread().interrupt();
              throw new RuntimeException(e);
          }
          this.thread.shutdown();
          buffer.clear();
  
  
          backedIterator.reset();
          shouldWork.set(true);
          this.thread = new AsyncPrefetchThread(buffer, backedIterator, terminator, null);
  
          /**
           * We want to ensure, that background thread will have the same thread->device affinity, as master thread
           */
          Nd4j.getAffinityManager().attachThreadToDevice(thread, deviceId);
  
          thread.setDaemon(true);
          thread.start();
          hasDepleted.set(false);
  
          nextElement = null;
      }