code: public void execBackwards(Map<String,INDArray> placeholders){
          if (getFunction("grad") == null) {
              createGradFunction();
          }
  
          //Collect (unique) list of gradient names...
          Set<String> varGradNames = new HashSet<>();
          for(Variable v : variables.values()){
              if(v.getVariable().getVariableType() == VariableType.VARIABLE){
                  SDVariable g = v.getVariable().gradient();
                  if(g != null) {
                      //Not all variables can have gradients... for example: suppose graph has 2 independent loss functions,
                      // optimizing only 1 might not require changing all variables
                      varGradNames.add(g.getVarName());
                  }
              }
          }
  
          //Edge case: if no variables, no variable gradients to calculate...
          if(varGradNames.isEmpty()){
              log.warn("Skipping gradient execution (backward pass) - no variables to be calculated (graph does not contain any VARIABLE type SDVariables).\n" +
                      "If gradients for other variables (such as placeholders) are required, use execBackwards(Map, List) instead");
              return;
          }
  
          List<String> vargradNamesList = new ArrayList<>(varGradNames);
          execBackwards(placeholders, vargradNamesList);
      }
docs: Create (if required) and then calculate the variable gradients (backward pass) for this graph.<br>
  After execution, the gradient arrays can be accessed using {@code myVariable.getGradient().getArr()}<br>
  <b>Note</b>: This method by default calculates VARIABLE type SDVariable gradients only (as well as any other
  gradients needed to calculate the variable gradients). That is, placeholder, constant, etc gradients are not
  calculated. If these gradients are required, they can be calculated using {@link #execBackwards(Map, List)} instead,
  which allows specifying the set of SDVariables to calculate the gradients for. For example,
  {@code execBackwards(placeholders, Arrays.asList(myPlaceholder.gradient().getVarName())}. In some cases,
  {@link #createGradFunction()} may need to be called first
  
  @param placeholders Values for the placeholder variables in the graph. For graphs without placeholders, use null or an empty map