分配固定数量分片的分区器。
继承自:Partitioner
用法
tf.distribute.experimental.partitioners.FixedShardsPartitioner(
num_shards
)
参数
-
num_shards
int
,要分区的分片数。
例子:
# 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)
相关用法
- Python tf.distribute.experimental.partitioners.FixedShardsPartitioner.__call__用法及代码示例
- Python tf.distribute.experimental.partitioners.Partitioner.__call__用法及代码示例
- Python tf.distribute.experimental.partitioners.MaxSizePartitioner.__call__用法及代码示例
- Python tf.distribute.experimental.partitioners.MinSizePartitioner用法及代码示例
- Python tf.distribute.experimental.partitioners.MaxSizePartitioner用法及代码示例
- Python tf.distribute.experimental.partitioners.MinSizePartitioner.__call__用法及代码示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.gather用法及代码示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy用法及代码示例
- Python tf.distribute.experimental.rpc.Server.create用法及代码示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.experimental_distribute_dataset用法及代码示例
- Python tf.distribute.experimental.TPUStrategy.experimental_distribute_values_from_function用法及代码示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.run用法及代码示例
- Python tf.distribute.experimental.TPUStrategy.experimental_distribute_dataset用法及代码示例
- Python tf.distribute.experimental.ParameterServerStrategy.gather用法及代码示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.scope用法及代码示例
- Python tf.distribute.experimental.TPUStrategy用法及代码示例
- Python tf.distribute.experimental.MultiWorkerMirroredStrategy.reduce用法及代码示例
- Python tf.distribute.experimental.ParameterServerStrategy.experimental_distribute_values_from_function用法及代码示例
- Python tf.distribute.experimental.CentralStorageStrategy.experimental_distribute_values_from_function用法及代码示例
- Python tf.distribute.experimental.CentralStorageStrategy用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.distribute.experimental.partitioners.FixedShardsPartitioner。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。