docs: public void convertToVariables(@NonNull List<SDVariable> constants){
          if(constants.size() == 0)
              return;
          boolean allConst = true;
          for(SDVariable variable : constants) {
              if (variable.getVariableType() != VariableType.VARIABLE) {
                  allConst = false;
              }
              Preconditions.checkState(variable.getVariableType() != VariableType.ARRAY, "Cannot convert variable of type ARRAY to a variable: %s", variable);
          }
          if(allConst){
              return; //No op
          }
  
          //Remove all sessions in case they have any cached arrays/state
          sessions.clear();
  
          //If gradient function has been defined, remove it (so it will be recreated later)
          sameDiffFunctionInstances.remove("grad");
  
          for(SDVariable variable : constants) {
              String n = variable.getVarName();
              INDArray arr = variable.getArr();
              Preconditions.checkNotNull(arr, "Could not get array for variable %s: if this is a placeholder, use SDVariable.setArray before converting", variable);
  
              variablesArrays.put(n, new DeviceLocalNDArray(arr));
              constantArrays.remove(n);
              if(!placeholdersPerThread.isEmpty()){
                  for(Map<String,INDArray> m : placeholdersPerThread.values()){
                      m.remove(n);
                  }
              }
  
              variable.setVariableType(VariableType.VARIABLE);
          }
  
  
          //For training: need to add new updater state
          if(trainingConfig != null){
              List<String> newTrainableParams = new ArrayList<>(trainingConfig.getTrainableParams());
              List<String> convertedToVars = new ArrayList<>();
              for(SDVariable v : constants){
                  newTrainableParams.add(v.getVarName());
                  convertedToVars.add(v.getVarName());
              }
              trainingConfig.setTrainableParams(newTrainableParams);
  
  
              //Add updater state for this variable: updaterState, updaterViews, updaterMap
              if(initializedTraining){
                  long extraStateSize = 0;
                  for (String s : convertedToVars) {
                      INDArray arr = getVariable(s).getArr();
                      long stateSize = trainingConfig.getUpdater().stateSize(arr.length());
                      extraStateSize += stateSize;
                  }
                  if(extraStateSize > 0) {
                      INDArray newState = Nd4j.createUninitialized(updaterState.dataType(), 1, extraStateSize);
  
                      updaterState = (updaterState == null ? newState : Nd4j.concat(1, updaterState, newState));
                      //Now, update updaterViews map:
                      long viewSoFar = 0;
                      updaterViews = new HashMap<>();
                      updaterMap = new HashMap<>();
                      for (String s : trainingConfig.getTrainableParams()) {
                          long thisSize = trainingConfig.getUpdater().stateSize(this.variables.get(s).getVariable().getArr().length());
                          INDArray view = (updaterState == null || thisSize == 0 ? null :
                                  updaterState.get(NDArrayIndex.interval(0, 1), NDArrayIndex.interval(viewSoFar, viewSoFar + thisSize)));
  
                          updaterViews.put(s, view);
                          boolean init = convertedToVars.contains(s); //Only initialize/zero the states for the new variables
                          updaterMap.put(s, trainingConfig.getUpdater().instantiate(view, init));
                          viewSoFar += thisSize;
                      }
                  }
              }
          }
      }