code: def testPmfNonIntegerCounts(self):
      p = [[0.1, 0.2, 0.7]]
      n = [[5.0]]
      with self.cached_session():
          # No errors with integer n.
          multinom = multinomial.Multinomial(
              total_count=n, probs=p, validate_args=True
          )
          multinom.prob([2.0, 1, 2]).eval()
          multinom.prob([3.0, 0, 2]).eval()
          # Counts don't sum to n.
          with self.assertRaisesOpError(
              "counts must sum to `self.total_count`"
          ):
              multinom.prob([2.0, 3, 2]).eval()
          # Counts are non-integers.
          x = array_ops.placeholder(dtypes.float32)
          with self.assertRaisesOpError(
              "cannot contain fractional components."
          ):
              multinom.prob(x).eval(feed_dict={x: [1.0, 2.5, 1.5]})
  
          multinom = multinomial.Multinomial(
              total_count=n, probs=p, validate_args=False
          )
          multinom.prob([1.0, 2.0, 2.0]).eval()
          # Non-integer arguments work.
          multinom.prob([1.0, 2.5, 1.5]).eval()
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.distributions import multinomial
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the MultinomialTest obj's underlying member method code with example usage: obj.testPmfNonIntegerCounts() without return types