TensorFlow Serving C++ API Documentation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tensorflow::serving::TfrtSavedModelFactory Class Reference

#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)
 

Detailed Description

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.

Member Function Documentation

◆ Create()

absl::Status tensorflow::serving::TfrtSavedModelFactory::Create ( const TfrtSavedModelConfig &  config,
std::unique_ptr< TfrtSavedModelFactory > *  factory 
)
static

Instantiates a TfrtSavedModelFactory using a config.

Parameters
configConfig with initialization options.
factoryNewly created factory if the returned Status is OK.

Definition at line 152 of file tfrt_saved_model_factory.cc.

◆ CreateTfrtSavedModelWithMetadata()

virtual absl::Status tensorflow::serving::TfrtSavedModelFactory::CreateTfrtSavedModelWithMetadata ( const Loader::Metadata metadata,
const string &  path,
std::unique_ptr< Servable > *  servable 
)
virtual

Instantiates a tfrt_stub::SavedModel from a given export or SavedModel path and the given metadata.

Parameters
metadataMetadata to be associated with the saved_model.
pathPath to the model.
servableNewly created Servable if the returned Status is OK.

◆ EstimateResourceRequirement()

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.

Parameters
pathPath to the model.
estimateOutput 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.


The documentation for this class was generated from the following files: