Shortcuts

Struct LoadBalancer

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

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources