code: private static int[] getDims(VarSet vars) {
          int[] dims = new int[vars.size()];
          for (int i=0; i<vars.size(); i++) {
              dims[i] = vars.get(i).getNumStates();
          }
          return dims;
      }
docs: Gets the tensor dimensions: dimension i corresponds to the i'th variable, and the size of
  that dimension is the number of states for the variable.