Struct LoadBalancer¶
Defined in File deploy.h
Struct Documentation¶
-
struct LoadBalancer¶
The default LoadBalancer for torch::deploy which handles allocating and freeing subinterpreters.
Public Functions
-
inline explicit LoadBalancer(size_t n)¶
Creates a Loadbalancer which handles
n
interpreters.
-
inline void setResourceLimit(size_t n)¶
Changes the amount of subinterpreters which is handled by the load balancer.
-
int acquire()¶
Allocates an subinterpreter, and return its ID which is used to free it.
-
void free(int where)¶
Frees the subinterpreter with ID
where
.This ID is returned by
LoadBalancer::acquire()
-
inline explicit LoadBalancer(size_t n)¶