class_docstr: This is a medium test due to the moments computation taking some time.
class_docstr_tok: ["This","is","a","medium","test","due","to","the","moments","computation","taking","some","time","."]
code: def testShape(self):
      # Fully known shape.
      rnd = random_ops.random_gamma([150], 2.0)
      self.assertEqual([150], rnd.get_shape().as_list())
      rnd = random_ops.random_gamma([150], 2.0, beta=[3.0, 4.0])
      self.assertEqual([150, 2], rnd.get_shape().as_list())
      rnd = random_ops.random_gamma([150], array_ops.ones([1, 2, 3]))
      self.assertEqual([150, 1, 2, 3], rnd.get_shape().as_list())
      rnd = random_ops.random_gamma([20, 30], array_ops.ones([1, 2, 3]))
      self.assertEqual([20, 30, 1, 2, 3], rnd.get_shape().as_list())
      rnd = random_ops.random_gamma(
          [123], array_ops.placeholder(dtypes.float32, shape=(2,))
      )
      self.assertEqual([123, 2], rnd.get_shape().as_list())
      # Partially known shape.
      rnd = random_ops.random_gamma(
          array_ops.placeholder(dtypes.int32, shape=(1,)),
          array_ops.ones([7, 3]),
      )
      self.assertEqual([None, 7, 3], rnd.get_shape().as_list())
      rnd = random_ops.random_gamma(
          array_ops.placeholder(dtypes.int32, shape=(3,)),
          array_ops.ones([9, 6]),
      )
      self.assertEqual(
          [None, None, None, 9, 6], rnd.get_shape().as_list()
      )
      # Unknown shape.
      rnd = random_ops.random_gamma(
          array_ops.placeholder(dtypes.int32),
          array_ops.placeholder(dtypes.float32),
      )
      self.assertIs(None, rnd.get_shape().ndims)
      rnd = random_ops.random_gamma(
          [50], array_ops.placeholder(dtypes.float32)
      )
      self.assertIs(None, rnd.get_shape().ndims)
  
imports: import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import test_util
  from tensorflow.python.kernel_tests.random import util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 15 for calling the RandomGammaTest obj's underlying member method code with example usage: obj.testShape() without return types