code: public static VarTensor safeNewVarTensor(Algebra s, Factor f) {
          VarTensor factor;
          // Create a VarTensor which the values of this non-explicitly represented factor.
          factor = new VarTensor(s, f.getVars());
          for (int c=0; c<factor.size(); c++) {
              factor.setValue(c, s.fromLogProb(f.getLogUnormalizedScore(c)));
          }
          return factor;
      }
docs: Gets this factor as a VarTensor. This will always return a new object. See also safeGetVarTensor().