code: public void setCacheMode(CacheMode mode) {
          if (mode == null)
              mode = CacheMode.NONE;
  
          for (Layer layer : layers) {
              layer.setCacheMode(mode);
          }
      }
docs: This method sets specified CacheMode for all layers within network
  
  @param mode