Remove unused ListFunctions API from experimental C Saved Model interface.
PiperOrigin-RevId: 340550186 Change-Id: Ie4197ed3a0c293a6504da90be287308f39453351
This commit is contained in:
parent
6136e252f1
commit
317c2b8460
@ -46,8 +46,6 @@ class SavedModelAPI {
|
|||||||
virtual Status GetSignatureDefFunction(const std::string& signature_def_key,
|
virtual Status GetSignatureDefFunction(const std::string& signature_def_key,
|
||||||
SignatureDefFunction** function) = 0;
|
SignatureDefFunction** function) = 0;
|
||||||
|
|
||||||
virtual std::vector<ConcreteFunction*> ListFunctions() = 0;
|
|
||||||
|
|
||||||
virtual ~SavedModelAPI() = default;
|
virtual ~SavedModelAPI() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -211,15 +211,6 @@ Status TFSavedModelAPI::GetSignatureDefFunction(
|
|||||||
return Status();
|
return Status();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ConcreteFunction*> TFSavedModelAPI::ListFunctions() {
|
|
||||||
std::vector<ConcreteFunction*> result;
|
|
||||||
result.reserve(revived_objects_.concrete_functions.size());
|
|
||||||
for (auto& index_and_function : revived_objects_.concrete_functions) {
|
|
||||||
result.push_back(index_and_function.second.get());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status TFSavedModelAPI::GetVariable(const std::string& variable_path,
|
Status TFSavedModelAPI::GetVariable(const std::string& variable_path,
|
||||||
Variable** variable) {
|
Variable** variable) {
|
||||||
absl::optional<int> node =
|
absl::optional<int> node =
|
||||||
|
@ -66,8 +66,6 @@ class TFSavedModelAPI : public SavedModelAPI {
|
|||||||
ImmediateExecutionContext* context,
|
ImmediateExecutionContext* context,
|
||||||
std::unique_ptr<TFSavedModelAPI>* out);
|
std::unique_ptr<TFSavedModelAPI>* out);
|
||||||
|
|
||||||
std::vector<ConcreteFunction*> ListFunctions() override;
|
|
||||||
|
|
||||||
~TFSavedModelAPI() override = default;
|
~TFSavedModelAPI() override = default;
|
||||||
|
|
||||||
Status GetVariable(const std::string& variable_path, Variable** variable);
|
Status GetVariable(const std::string& variable_path, Variable** variable);
|
||||||
|
@ -122,9 +122,4 @@ TF_GetSavedModelSignatureDefFunction(TF_SavedModel* model,
|
|||||||
return tensorflow::wrap(result);
|
return tensorflow::wrap(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
TF_ConcreteFunctionList* TF_ListSavedModelFunctions(TF_SavedModel* model) {
|
|
||||||
return new TF_ConcreteFunctionList{
|
|
||||||
tensorflow::unwrap(model)->ListFunctions()};
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end extern "C"
|
} // end extern "C"
|
||||||
|
@ -100,11 +100,6 @@ TF_GetSavedModelSignatureDefFunction(TF_SavedModel* model,
|
|||||||
const char* signature_def_key,
|
const char* signature_def_key,
|
||||||
TF_Status* status);
|
TF_Status* status);
|
||||||
|
|
||||||
// Returns a list of all ConcreteFunctions stored in this SavedModel.
|
|
||||||
// The lifetime of the returned list is bound to `model`.
|
|
||||||
TF_CAPI_EXPORT extern TF_ConcreteFunctionList* TF_ListSavedModelFunctions(
|
|
||||||
TF_SavedModel* model);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // end extern "C"
|
} // end extern "C"
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
@ -84,9 +84,6 @@ class SavedModelAPI {
|
|||||||
SignatureDefFunction* GetSignatureDefFunction(
|
SignatureDefFunction* GetSignatureDefFunction(
|
||||||
const std::string& function_path, Status* status);
|
const std::string& function_path, Status* status);
|
||||||
|
|
||||||
// Lists all Concrete Functions available from the SavedModel.
|
|
||||||
std::vector<ConcreteFunction*> ListFunctions();
|
|
||||||
|
|
||||||
// SavedModelAPI is movable, but not copyable.
|
// SavedModelAPI is movable, but not copyable.
|
||||||
SavedModelAPI(SavedModelAPI&&) = default;
|
SavedModelAPI(SavedModelAPI&&) = default;
|
||||||
SavedModelAPI& operator=(SavedModelAPI&&) = default;
|
SavedModelAPI& operator=(SavedModelAPI&&) = default;
|
||||||
@ -151,11 +148,6 @@ inline SignatureDefFunction* SavedModelAPI::GetSignatureDefFunction(
|
|||||||
return SignatureDefFunction::wrap(function);
|
return SignatureDefFunction::wrap(function);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::vector<ConcreteFunction*> SavedModelAPI::ListFunctions() {
|
|
||||||
ConcreteFunctionList list(TF_ListSavedModelFunctions(saved_model_.get()));
|
|
||||||
return list.ToVector();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace cc
|
} // namespace cc
|
||||||
} // namespace experimental
|
} // namespace experimental
|
||||||
} // namespace tensorflow
|
} // namespace tensorflow
|
||||||
|
Loading…
Reference in New Issue
Block a user