code: def test_metrics_with_binary_averaging(self):
      x = Multinomial(
          total_count=10.0, probs=tf.constant([0.2, 0.7, 0.1])
      )
      x_data = tf.constant([5, 4, 1], dtype=x.dtype.as_numpy_dtype)
      self.assertAllEqual(
          np.array([9.0, 4.0, 1.0], dtype=np.float32),
          ed.evaluate(
              [("mean_squared_error", {"average": None})],
              {x: x_data},
              n_samples=1,
              seed=self.RANDOM_SEED,
          ),
      )
      x = Multinomial(
          total_count=10.0, probs=tf.constant([0.2, 0.7, 0.1])
      )
      x_data = tf.constant([5, 4, 1], dtype=x.dtype.as_numpy_dtype)
      self.assertAllClose(
          4.6666665,
          ed.evaluate(
              [("mean_squared_error", {"average": "macro"})],
              {x: x_data},
              n_samples=1,
              seed=self.RANDOM_SEED,
          ),
      )
      x = Multinomial(
          total_count=10.0, probs=tf.constant([0.2, 0.7, 0.1])
      )
      x_data = tf.constant([5, 4, 1], dtype=x.dtype.as_numpy_dtype)
      self.assertAllClose(
          4.6666665,
          ed.evaluate(
              [("mean_squared_error", {"average": "micro"})],
              {x: x_data},
              n_samples=1,
              seed=self.RANDOM_SEED,
          ),
      )
  
      x = Multinomial(
          total_count=10.0,
          probs=tf.constant([0.2, 0.7, 0.1]),
          sample_shape=5,
      )
      x_data = tf.constant(
          [[2, 7, 1], [3, 6, 1], [3, 5, 2], [4, 4, 2], [2, 7, 1]],
          dtype=x.dtype.as_numpy_dtype,
      )
      self.assertAllEqual(
          np.array([1.2, 1.4, 0.6], dtype=np.float32),
          ed.evaluate(
              [("mean_squared_error", {"average": None})],
              {x: x_data},
              n_samples=1,
              seed=self.RANDOM_SEED,
          ),
      )
      x = Multinomial(
          total_count=10.0,
          probs=tf.constant([0.2, 0.7, 0.1]),
          sample_shape=5,
      )
      x_data = tf.constant(
          [[2, 7, 1], [3, 6, 1], [3, 5, 2], [4, 4, 2], [2, 7, 1]],
          dtype=x.dtype.as_numpy_dtype,
      )
      self.assertAllClose(
          1.066666603088379,
          ed.evaluate(
              [("mean_squared_error", {"average": "macro"})],
              {x: x_data},
              n_samples=1,
              seed=self.RANDOM_SEED,
          ),
      )
      x = Multinomial(
          total_count=10.0,
          probs=tf.constant([0.2, 0.7, 0.1]),
          sample_shape=5,
      )
      x_data = tf.constant(
          [[2, 7, 1], [3, 6, 1], [3, 5, 2], [4, 4, 2], [2, 7, 1]],
          dtype=x.dtype.as_numpy_dtype,
      )
      self.assertAllClose(
          1.0666667222976685,
          ed.evaluate(
              [("mean_squared_error", {"average": "micro"})],
              {x: x_data},
              n_samples=1,
              seed=self.RANDOM_SEED,
          ),
      )
  
file_path: edward/tests/criticisms/evaluate_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import tensorflow
  from edward.models import Bernoulli, Categorical, Multinomial, Normal
label_desc: Use image node_id 3 for calling the test_evaluate_class obj's underlying member method code with example usage: obj.test_metrics_with_binary_averaging() without return types