tf.distribute.experimental.partitioners.FixedShardsPartitioner

Partitioner that allocates a fixed number of shards.

Inherits From: Partitioner

Examples:

# standalone usage:
partitioner = FixedShardsPartitioner(num_shards=2)
partitions = partitioner(tf.TensorShape([10, 3]), tf.float32)
[2, 1]

# use in ParameterServerStrategy
# strategy = tf.distribute.experimental.ParameterServerStrategy(
#   cluster_resolver=cluster_resolver, variable_partitioner=partitioner)

num_shards int, number of shards to partition.

Methods

__call__

View source

Partitions the given shape and returns the parti