class_docstr: Centralised, batched inference server.
class_docstr_tok: ["Centralised",",","batched","inference","server","."]
docstr: Constructs an inference server object.
  
  Args:
    handler: A callable or a mapping of callables to be exposed
      through the inference server.
    variable_source: Source of variables
    devices: Devices used for executing handlers. All devices are used in
      parallel.
    config: Inference Server configuration.
docstr_tok: ["Constructs","an","inference","server","object",".","Args",":","handler",":","A","callable","or","a","mapping","of","callables","to","be","exposed","through","the","inference","server",".","variable_source",":","Source","of","variables","devices",":","Devices","used","for","executing","handlers",".","All","devices","are","used","in","parallel",".","config",":","Inference","Server","configuration","."]
code: def __init__(
      self,
      handler: InferenceServerHandler,
      variable_source: acme.VariableSource,
      devices: Sequence[jax.Device],
      config: InferenceServerConfig,
  ):
      """Constructs an inference server object.
  
      Args:
        handler: A callable or a mapping of callables to be exposed
          through the inference server.
        variable_source: Source of variables
        devices: Devices used for executing handlers. All devices are used in
          parallel.
        config: Inference Server configuration.
      """
      self._variable_source = variable_source
      self._variable_client = None
      self._keys = []
      self._devices = devices
      self._config = config
      self._call_cnt = 0
      self._device_params = [None] * len(self._devices)
      self._device_params_ids = [None] * len(self._devices)
      self._mutex = threading.Lock()
      self._handler = jax.tree_map(
          self._build_handler, handler, is_leaf=callable
      )
  
file_path: acme/acme/jax/inference_server.py
imports: import dataclasses
  import datetime
  import threading
  from typing import Any, Callable, Generic, Optional, Sequence, TypeVar
  import acme
  from acme.jax import variable_utils
  import jax
  import launchpad
label_desc: Use image node_id 1 to create a new InferenceServer object from inherited base classes: Generic with example: obj = InferenceServer(handler, variable_source, devices, config)