code: @Override
      public void touch() {
          if (index.get() == null) {
              // set index
              int numDevces = Nd4j.getAffinityManager().getNumberOfDevices();
  
              /*
                  if we have > 1 computational device, we assign workers to workspaces "as is", as provided via AffinityManager
               */
              if (numDevces > 1 && parties > 1) {
                  int localIndex = Nd4j.getAffinityManager().getDeviceForCurrentThread();
  
                  index.set(localIndex);
              } else {
                  // if we have only 1 device (like cpu system, or single gpu), just attach consumer via flat index
                  index.set(workersCounter.getAndIncrement());
              }
          }
      }
docs: This method does initialization of given worker wrt Thread-Device Affinity