code: def test_MaxShardSizePolicy_LargeScalar(self):
      v_string = "".join(
          random.choices(string.ascii_uppercase + string.digits, k=10)
      ).encode("utf-8")
      root = module.Module()
      with ops.device("cpu:0"):
          v0 = resource_variable_ops.ResourceVariable(
              v_string, name="v0", dtype=dtypes.string
          )
      self.evaluate(v0.initializer)
      root.v0 = v0
  
      v0_name = "v0/.ATTRIBUTES/VARIABLE_VALUE"
  
      shardable_tensors = self._get_shardable_tensors_by_task(root)
  
      # max_shard_size: 8 bytes
      callback = sharding_policies.MaxShardSizePolicy(max_shard_size=8)
      shards = []
      for tensors in shardable_tensors:
          shards.extend(callback(tensors))
  
      self.assertEqual(
          [set(shard.keys()) for shard in shards],
          [
              {
                  "v0/.ATTRIBUTES/VARIABLE_VALUE",
              },
              {
                  "_CHECKPOINTABLE_OBJECT_GRAPH",
              },
          ],
      )
  
      tensor_val = (
          self.evaluate(shards[0][v0_name][""])
          if ops.context.executing_eagerly()
          else shards[0][v0_name][""]
      )
      self.assertEqual(tensor_val, v_string)
  
imports: import random
  import string
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import graph_view
  from tensorflow.python.checkpoint.sharding import sharding_policies
  from tensorflow.python.checkpoint.sharding import sharding_util
  from tensorflow.python.eager import remote
  from tensorflow.python.eager import test
  from tensorflow.python.framework import device
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.module import module
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.training import server_lib
  from tensorflow.python.training.saving import saveable_object
  from tensorflow.python.training.saving import saveable_object_util
label_desc: Use image node_id 6 for calling the ShardingPoliciesTest obj's underlying member method code with example usage: obj.test_MaxShardSizePolicy_LargeScalar() without return types