TensorFlow Serving C++ API Documentation
|
#include <tfrt_saved_model_factory.h>
Public Types | |
using | Batcher = SharedBatchScheduler< SavedModelBatchingTask > |
Public Member Functions | |
TfrtSavedModelFactory (const TfrtSavedModelConfig &config, std::shared_ptr< Batcher > batch_scheduler, std::unique_ptr< ThreadPoolFactory > thread_pool_factory) | |
TfrtSavedModelFactory (const TfrtSavedModelConfig &config, std::shared_ptr< Batcher > batch_scheduler, std::unique_ptr< ThreadPoolFactory > thread_pool_factory, std::function< std::unique_ptr< RequestRecorder >(TfrtSavedModelServable &)> recorder_creator) | |
virtual absl::Status | CreateTfrtSavedModelWithMetadata (const Loader::Metadata &metadata, const string &path, std::unique_ptr< Servable > *servable) |
absl::Status | CreateTfrtSavedModelWithMetadata (const Loader::Metadata &metadata, const string &path, std::unique_ptr< tfrt_stub::SavedModel > *saved_model) |
absl::Status | EstimateResourceRequirement (const string &path, ResourceAllocation *estimate) const |
const TfrtSavedModelConfig & | config () const |
TfrtSavedModelConfig & | mutable_config () |
absl::string_view | GetServingResourceType () const |
Static Public Member Functions | |
static absl::Status | Create (const TfrtSavedModelConfig &config, std::unique_ptr< TfrtSavedModelFactory > *factory) |
A factory that creates tfrt_stub::SavedModel from SavedModel export paths.
The factory can also estimate the resource (e.g. RAM) requirements of a tfrt_stub::SavedModel based on the SavedModel (i.e. prior to loading the session).
This class is thread-safe.
Definition at line 49 of file tfrt_saved_model_factory.h.
|
static |
Instantiates a TfrtSavedModelFactory using a config.
config | Config with initialization options. |
factory | Newly created factory if the returned Status is OK. |
Definition at line 152 of file tfrt_saved_model_factory.cc.
|
virtual |
Instantiates a tfrt_stub::SavedModel from a given export or SavedModel path and the given metadata.
metadata | Metadata to be associated with the saved_model. |
path | Path to the model. |
servable | Newly created Servable if the returned Status is OK. |
absl::Status tensorflow::serving::TfrtSavedModelFactory::EstimateResourceRequirement | ( | const string & | path, |
ResourceAllocation * | estimate | ||
) | const |
Estimates the resources a SavedModel will use once loaded, from its export path.
path | Path to the model. |
estimate | Output resource usage estimates. Different kinds of resources (e.g. CPU, RAM, etc.) may get populated. |
Definition at line 164 of file tfrt_saved_model_factory.cc.