An instance of grpc.Channel to use for communication with the
remote executor service.
rpc_mode
Optional mode of calling the remote executor. Must be either
'REQUEST_REPLY' or 'STREAMING' (defaults to 'REQUEST_REPLY'). This
option will be removed after the request-reply interface is deprecated.
thread_pool_executor
Optional concurrent.futures.Executor used to wait
for the reply to a streaming RPC message. Uses the default Executor if
not specified.
dispose_batch_size
The batch size for requests to dispose of remote
worker values. Lower values will result in more requests to the remote
worker, but will result in values being cleaned up sooner and therefore
may result in lower memory usage on the remote worker.
A coroutine that creates a call to comp with optional argument arg.
Args
comp
The computation to invoke. It must have been first embedded in the
executor by calling create_value() on it first.
arg
An optional argument of the call, or None if no argument was
supplied. If it is present, it must have been embedded in the executor
by calling create_value() on it first.
Returns
An instance of ExecutorValue that represents the constructed call.
A collection of ExecutorValues to create a tuple from. The
collection may be of any kind accepted by
structure.from_container, including dictionaries and lists. The
ExecutorValues in the container must have been created by calling
create_value on this executor.
Returns
An instance of ExecutorValue that represents the constructed tuple.
A coroutine that creates embedded value from value of type type_spec.
This function is used to embed a value within the executor. The argument
can be one of the plain Python types, a nested structure, a representation
of a TFF computation, etc. Once embedded, the value can be further passed
around within the executor. For functional values, embedding them prior to
invocation potentially allows the executor to amortize overhead across
multiple calls.
Args
value
An object that represents the value to embed within the executor.
type_spec
An optional tff.Type of the value represented by this object,
or something convertible to it. The type can only be omitted if the
value is a instance of tff.TypedObject.
Returns
An instance of ExecutorValue that represents the embedded value.