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

#include <loader.h>

Inheritance diagram for tensorflow::serving::ResourceUnsafeLoader:
Inheritance graph
[legend]
Collaboration diagram for tensorflow::serving::ResourceUnsafeLoader:
Collaboration graph
[legend]

Public Member Functions

Status EstimateResources (ResourceAllocation *estimate) const final
 
- Public Member Functions inherited from tensorflow::serving::Loader
virtual ~Loader ()=default
 
virtual Status Load ()
 
virtual Status LoadWithMetadata (const Metadata &metadata)
 
virtual void Unload ()=0
 
virtual AnyPtr servable ()=0
 

Detailed Description

A Loader that is oblivious to resources. Its EstimateResources() method returns 0, thus effectively disabling resource-based safety checks in the serving system.

Loaders that are experimental, or run in environments that do not need the resource safety checks, can subclass ResourceUnsafeLoader instead of Loader.

Definition at line 155 of file loader.h.

Member Function Documentation

◆ EstimateResources()

Status tensorflow::serving::ResourceUnsafeLoader::EstimateResources ( ResourceAllocation *  estimate) const
inlinefinalvirtual

Estimates the resources a servable will use.

IMPORTANT: This method's implementation must obey following requirements, which enable the serving system to reason correctly about which servables can be loaded safely:

  1. The estimate must represent an upper bound on the actual value.
  2. Prior to load, the estimate may include resources that are not bound to any specific device instance, e.g. RAM on one of the two GPUs.
  3. While loaded, for any devices with multiple instances (e.g. two GPUs), the estimate must specify the instance to which each resource is bound.
  4. The estimate must be monotonically non-increasing, i.e. it cannot increase over time. Reasons to have it potentially decrease over time
    Returns
    an estimate of the resources the servable will consume once loaded. If the servable has already been loaded, returns an estimate of the actual resource usage.

Implements tensorflow::serving::Loader.

Definition at line 157 of file loader.h.


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