配置TPU
关于如何配置TPU,官方文档(Tensor Processing Units (TPUs))里面写的明明白白:
Once you have flipped the “Accelerator” switch in your notebook to “TPU v3-8”, this is how to enable TPU training in Tensorflow Keras:
# detect and init the TPU
tpu = tf.distribute.cluster