分配固定數量分片的分區器。
繼承自: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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。