TensorFlow Serving C++ API Documentation
|
Public Member Functions | |
FakeLoader (int64_t servable, const Status load_status=Status()) | |
Status | load_status () |
Status | Load () override |
void | Unload () override |
AnyPtr | servable () override |
![]() | |
Status | EstimateResources (ResourceAllocation *estimate) const final |
![]() | |
virtual | ~Loader ()=default |
virtual Status | LoadWithMetadata (const Metadata &metadata) |
Static Public Member Functions | |
static int | num_fake_loaders () |
static bool | was_deleted_in_this_thread () |
Definition at line 37 of file fake_loader.h.
|
overridevirtual |
Fetches any data that needs to be loaded before using the servable returned by servable(). May use no more resources than the estimate reported by EstimateResources().
If implementing Load(), you don't have to override LoadWithMetadata().
Reimplemented from tensorflow::serving::Loader.
Definition at line 47 of file fake_loader.cc.
|
overridevirtual |
Returns an opaque interface to the underlying servable object. The caller should know the precise type of the interface in order to make actual use of it. For example:
CustomLoader implementation:
class CustomLoader : public Loader { public: ... Status Load() override { servable_ = ...; } AnyPtr servable() override { return servable_; } private: CustomServable* servable_ = nullptr; };
Serving user request:
ServableHandle<CustomServable> handle = ... CustomServable* servable = handle.get(); servable->...
If servable() is called after successful Load() and before Unload(), it returns a valid, non-null AnyPtr object. If called before a successful Load() call or after Unload(), it returns null AnyPtr.
Implements tensorflow::serving::Loader.
Definition at line 51 of file fake_loader.cc.
|
overridevirtual |
Frees any resources allocated during Load() (except perhaps for resources shared across servables that are still needed for other active ones). The loader does not need to return to the "new" state (i.e. Load() cannot be called after Unload()).
Implements tensorflow::serving::Loader.
Definition at line 49 of file fake_loader.cc.