class_docstr: Tests for member functions of the class xla_sharding.Sharding.
docstr: Tests the various recommended ways to construct a Sharding object.
  
  This is the most minimal of tests, doesn't assert anything about the
  Sharding object produced by a given factory methods other than that it
  has the correct type.
docstr_tok: ["Tests","the","various","recommended","ways","to","construct","a","Sharding","object",".","This","is","the","most","minimal","of","tests",",","does","n't","assert","anything","about","the","Sharding","object","produced","by","a","given","factory","methods","other","than","that","it","has","the","correct","type","."]
code: def test_sharding_factory_functions_can_return_sharding_objects(self):
      """Tests the various recommended ways to construct a Sharding object.
  
      This is the most minimal of tests, doesn't assert anything about the
      Sharding object produced by a given factory methods other than that it
      has the correct type.
      """
      self.assertIsInstance(
          xla_sharding.Sharding.replicate(), xla_sharding.Sharding
      )
      self.assertIsInstance(
          xla_sharding.Sharding.manual(), xla_sharding.Sharding
      )
      self.assertIsInstance(
          xla_sharding.Sharding.assign_device(0), xla_sharding.Sharding
      )
      self.assertIsInstance(
          xla_sharding.Sharding.tile(np.ones([3], dtype=int)),
          xla_sharding.Sharding,
      )
      self.assertIsInstance(
          xla_sharding.Sharding.partial_tile(np.ones([3], dtype=int)),
          xla_sharding.Sharding,
      )
      self.assertIsInstance(
          xla_sharding.Sharding.split(
              array_ops.ones([3, 8, 7], dtype=dtypes.int32), 1, 2
          ),
          xla_sharding.Sharding,
      )
      self.assertIsInstance(
          xla_sharding.Sharding.subgroup_tile(
              np.ones([2, 3, 3], dtype=int),
              [
                  xla_data_pb2.OpSharding.REPLICATED,
                  xla_data_pb2.OpSharding.MANUAL,
              ],
          ),
          xla_sharding.Sharding,
      )
  
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 ShardingTest obj's underlying member method code with example usage: obj.test_sharding_factory_functions_can_return_sharding_objects() without return types