make_predict_function
- FullyConnected.make_predict_function(force=False)
Creates a function that executes one step of inference.
This method can be overridden to support custom inference logic. This method is called by Model.predict and Model.predict_on_batch.
Typically, this method directly controls tf.function and tf.distribute.Strategy settings, and delegates the actual evaluation logic to Model.predict_step.
This function is cached the first time Model.predict or Model.predict_on_batch is called. The cache is cleared whenever Model.compile is called. You can skip the cache and generate again the function with force=True.
- Parameters:
force – Whether to regenerate the predict function and skip the cached function if available.
- Returns:
Function. The function created by this method should accept a tf.data.Iterator, and return the outputs of the Model.