Add API to support graph_def based snapshots