class_docstr: Tests for non-member functions in the module xla_sharding.py.
code: def test_tile_annotates_tensor_correctly(self):
      @def_function.function
      def tile_helper(tensor):
          self.assertIsNone(xla_sharding.get_tensor_sharding(tensor))
          tiled_tensor = xla_sharding.tile(tensor, np.array([2, 1, 6]))
          self.assertIsInstance(tiled_tensor, tensor_lib.Tensor)
          tiled_sharding = xla_sharding.get_tensor_sharding(
              tiled_tensor
          )
          tile_shape = xla_sharding.get_sharding_tile_shape(
              tiled_sharding
          )
          # This is the shape of the tile assignment [2, 1, 6]
          expected_shape = [3]
          self.assertEqual(expected_shape, tile_shape)
          return tiled_tensor
  
      in_tensor = array_ops.ones([4, 5, 6], dtype=dtypes.float32)
      result = tile_helper(
          array_ops.ones([4, 5, 6], dtype=dtypes.float32)
      )
      self.assertAllEqual(in_tensor, result)
  
imports: from absl.testing import absltest
  import numpy
  from google.protobuf.message import DecodeError
  from local_xla.xla import xla_data_pb2
  from tensorflow.python.compiler.xla.experimental import xla_sharding
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
label_desc: Use image node_id 2 for calling the XlaShardingTest obj's underlying member method code with example usage: obj.test_tile_annotates_tensor_correctly() and returns: tiled_tensor