docstr: Tests getting an unsharded shape.
docstr_tok: ["Tests","getting","an","unsharded","shape","."]
code: def testGetUnshardedShape(self):
      """Tests getting an unsharded shape."""
      p = tpu_sharding.ShardingPolicy()
      p.set_number_of_shards(2)
      p.set_shard_dimension(1)
      self.assertEqual(p.get_unsharded_shape([[4, 3], [4, 3]]), [4, 6])
      with self.assertRaises(ValueError):
          _ = p.get_unsharded_shape([[4, 3]])
      with self.assertRaises(ValueError):
          _ = p.get_unsharded_shape([[4, 3], [4, 3], [4, 3]])
      with self.assertRaises(ValueError):
          _ = p.get_unsharded_shape([[4, 3], [4, 2]])
      with self.assertRaises(TypeError):
          _ = p.get_unsharded_shape([[4, 3], "not_a_shape"])
      with self.assertRaises(ValueError):
          _ = p.get_unsharded_shape([None, [4, 3]])
      with self.assertRaises(ValueError):
          _ = p.get_unsharded_shape([[2], [4, 3]])
  
file_path: tensorflow-upstream/tensorflow/python/tpu/tpu_sharding_test.py
imports: from tensorflow.python.framework import tensor_shape
  from tensorflow.python.platform import test
  from tensorflow.python.tpu import tpu_sharding
label_desc: Use image node_id 7 for calling the ShardingTest obj's underlying member method code with example usage: obj.testGetUnshardedShape() without return types