docs: private static TensorBuilder getTensorFromVariables(VariableNumMap variables) {
      // Get the dimensions and dimension sizes for the tensor.
      int[] dimensions = variables.getVariableNumsArray();
      int[] sizes = new int[dimensions.length];
      List<DiscreteVariable> varTypes = variables.getDiscreteVariables();
      for (int i = 0; i < varTypes.size(); i++) {
        sizes[i] = varTypes.get(i).numValues();
      }
      return new SparseTensorBuilder(dimensions, sizes);
    }