TensorFlow Serving C++ API Documentation
|
#include <aspired_versions_manager_builder.h>
Public Types | |
using | Options = AspiredVersionsManager::Options |
Public Member Functions | |
template<typename S > | |
void | AddSource (std::unique_ptr< S > source) |
template<typename S , typename SA , typename... Args> | |
void | AddSourceChain (std::unique_ptr< S > source, std::unique_ptr< SA > first_source_adapter, std::unique_ptr< Args >... remaining_source_adapters) |
std::unique_ptr< Manager > | Build () |
Builds the AspiredVersionsManager and returns it as the Manager interface. | |
Static Public Member Functions | |
static Status | Create (Options options, std::unique_ptr< AspiredVersionsManagerBuilder > *builder) |
Builds an AspiredVersionsManager with options and sources connected to it. It takes over the ownership of the sources and the returned manager handles the destruction of itself and its dependencies. Both single sources and source/source-adapter chains are accepted, i.e. you can use sources that directly supply loaders (Source<std::unique_ptr<Loader>>) or composites that consist of Source<S> + some chain of SourceAdapter<S, ...>, ..., SourceAdapter<..., std::unique_ptr<Loader>>. The builder connects the chain for you.
Usage:
... AspiredVersionsManagerBuilder::Options options = ManagerOptions(); std::unique_ptr<AspiredVersionsManagerBuilder> builder; TF_CHECK_OK(AspiredVersionsManagerBuilder::Create( std::move(options), &builder)); builder->AddSource(std::move(some_source)); builder->AddSourceChain( std::move(source), std::move(source_adapter1), std::move(source_adapter2)); std::unique_ptr<Manager> manager = builder->Build(); ...
NOTE: A builder can only be used to build a single AspiredVersionsManager.
This class is not thread-safe.
Definition at line 59 of file aspired_versions_manager_builder.h.
void tensorflow::serving::AspiredVersionsManagerBuilder::AddSource | ( | std::unique_ptr< S > | source | ) |
Connects the source to the AspiredVersionsManager being built and takes over its ownership.
REQUIRES: Template type S be convertible to Source<std::unique_ptr<Loader>>.
Definition at line 114 of file aspired_versions_manager_builder.h.
void tensorflow::serving::AspiredVersionsManagerBuilder::AddSourceChain | ( | std::unique_ptr< S > | source, |
std::unique_ptr< SA > | first_source_adapter, | ||
std::unique_ptr< Args >... | remaining_source_adapters | ||
) |
Connects a chain comprising a source and a chain of source adapters, s.t. the final adapter in the chain emits Loaders for the manager. The final adapter is connected to the manager. We take ownership of the whole chain.
REQUIRES: At least one source adapter.
Usage: builder->AddSourceChain( std::move(source), std::move(source_adapter1), std::move(source_adapter2));
Definition at line 123 of file aspired_versions_manager_builder.h.