docstr: Generate well distributed and well calibrated probabilities.
  
  Args:
    nsamples: int, >= 1, number of samples to generate.
    nclasses: int, >= 2, number of classes.
  
  Returns:
    logits: Tensor, shape (nsamples, nclasses), tf.float32, unnormalized log
      probabilities (logits) of the probabilistic predictions.
    labels: Tensor, shape (nsamples,), tf.int32, the true class labels.  Each
      element is in the range 0,..,nclasses-1.
docstr_tok: ["Generate","well","distributed","and","well","calibrated","probabilities",".","Args",":","nsamples",":","int",",",">","=","1",",","number","of","samples","to","generate",".","nclasses",":","int",",",">","=","2",",","number","of","classes",".","Returns",":","logits",":","Tensor",",","shape","(","nsamples",",","nclasses",")",",","tf.float32",",","unnormalized","log","probabilities","(","logits",")","of","the","probabilistic","predictions",".","labels",":","Tensor",",","shape","(","nsamples",",",")",",","tf.int32",",","the","true","class","labels",".","Each","element","is","in","the","range","0",",","..",",","nclasses-1","."]
code: def _generate_perfect_calibration_logits(self, nsamples, nclasses):
      """Generate well distributed and well calibrated probabilities.
  
      Args:
        nsamples: int, >= 1, number of samples to generate.
        nclasses: int, >= 2, number of classes.
  
      Returns:
        logits: Tensor, shape (nsamples, nclasses), tf.float32, unnormalized log
          probabilities (logits) of the probabilistic predictions.
        labels: Tensor, shape (nsamples,), tf.int32, the true class labels.  Each
          element is in the range 0,..,nclasses-1.
      """
      tf.random.set_seed(1)
      seed_stream = test_util.test_seed_stream()
      logits = 2.0 * tf.random.normal(
          (nsamples, nclasses), seed=seed_stream()
      )
      py = categorical.Categorical(logits=logits)
      labels = py.sample(seed=seed_stream())
  
      return logits, labels
  
imports: import itertools
  from absl import logging
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.stats import calibration
label_desc: Use image node_id 7 for calling the CalibrationTest obj's underlying member method code with example usage: obj._generate_perfect_calibration_logits(nsamples, nclasses) and returns: logits,  labels