mirror of
https://github.com/wassname/ray.git
synced 2026-07-08 18:24:45 +08:00
[Tune] Add export_formats option to export policy graphs (#3868)
In earlier PRs, PR#3585 and PR#3637, export_policy_model and export_policy_checkpoint were introduced for users to export TensorFlow model and checkpoint. For Ray Tune users, these APIs are not accessible through YAML configurations. In this pull request, export_formats option is provided to enable users to choose the desired export format.
This commit is contained in:
committed by
Richard Liaw
parent
b9eed2e86c
commit
1302fafc0b
@@ -205,3 +205,15 @@ class TrialExecutor(object):
|
||||
"""
|
||||
raise NotImplementedError("Subclasses of TrialExecutor must provide "
|
||||
"save() method")
|
||||
|
||||
def export_trial_if_needed(self, trial):
|
||||
"""Exports model of this trial based on trial.export_formats.
|
||||
|
||||
Args:
|
||||
trial (Trial): The state of this trial to be saved.
|
||||
|
||||
Return:
|
||||
A dict that maps ExportFormats to successfully exported models.
|
||||
"""
|
||||
raise NotImplementedError("Subclasses of TrialExecutor must provide "
|
||||
"export_trial_if_needed() method")
|
||||
|
||||
Reference in New Issue
Block a user