Watch keynotes, product sessions, workshops, and more from Google I/O See playlist


View source on GitHub

Copy model along with weights to the TPU. (deprecated)

Returns a TPU model.


a = Input(shape=(32,))
b = Dense(32)(a)
model = Model(inputs=a, outputs=b)

# If `num_cores_per_host` is greater than one, batch parallelism will be used
# to run on multiple TPU cores.
strategy = keras_support.TPUDistributionStrategy(tpu_cluster_resolver)
model = keras_support.tpu_model(model, strategy)

model A tf.keras.Model instance.
strategy TPUDistributionStrategy. The strategy to use for replicating model across multiple TPU cores.

A new KerasTPUModel instance.