MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testFrozen

Method testFrozen

tensorflow/python/tpu/tpu_sharding_test.py:44–51  ·  view source on GitHub ↗

Tests that frozen policies can't be changed.

(self)

Source from the content-addressed store, hash-verified

42 self.assertEqual(p2.shard_dimension, 23)
43
44 def testFrozen(self):
45 """Tests that frozen policies can't be changed."""
46 p1 = tpu_sharding.ShardingPolicy()
47 p1.freeze()
48 with self.assertRaises(ValueError):
49 p1.set_number_of_shards(17)
50 with self.assertRaises(ValueError):
51 p1.set_shard_dimension(22)
52
53 def testStr(self):
54 """Tests the string representation."""

Callers

nothing calls this directly

Calls 3

freezeMethod · 0.95
set_number_of_shardsMethod · 0.95
set_shard_dimensionMethod · 0.95

Tested by

no test coverage detected