Missed TensorFlow World? Check out the recap. Learn more

tff.framework.ExecutorService

View source on GitHub

Class ExecutorService

A wrapper around a target executor that makes it into a gRPC service.

NOTE: This component is only available in Python 3.

__init__

View source

__init__(
    executor,
    *args,
    **kwargs
)

Initialize self. See help(type(self)) for accurate signature.

Methods

Compute

View source

Compute(
    request,
    context
)

Computes a value embedded in the executor.

Args:

  • request: An instance of executor_pb2.ComputeRequest.
  • context: An instance of grpc.ServicerContext.

Returns:

An instance of executor_pb2.ComputeResponse.

CreateCall

View source

CreateCall(
    request,
    context
)

Creates a call embedded in the executor.

Args:

  • request: An instance of executor_pb2.CreateCallRequest.
  • context: An instance of grpc.ServicerContext.

Returns:

An instance of executor_pb2.CreateCallResponse.

CreateSelection

View source

CreateSelection(
    request,
    context
)

Creates a selection embedded in the executor.

Args:

  • request: An instance of executor_pb2.CreateSelectionRequest.
  • context: An instance of grpc.ServicerContext.

Returns:

An instance of executor_pb2.CreateSelectionResponse.

CreateTuple

View source

CreateTuple(
    request,
    context
)

Creates a tuple embedded in the executor.

Args:

  • request: An instance of executor_pb2.CreateTupleRequest.
  • context: An instance of grpc.ServicerContext.

Returns:

An instance of executor_pb2.CreateTupleResponse.

CreateValue

View source

CreateValue(
    request,
    context
)

Creates a value embedded in the executor.

Args:

  • request: An instance of executor_pb2.CreateValueRequest.
  • context: An instance of grpc.ServicerContext.

Returns:

An instance of executor_pb2.CreateValueResponse.

Dispose

View source

Dispose(
    request,
    context
)

TODO(b/134543154): Given that there is no support for asynchronous server processing in Python gRPC, long-running calls may be a problem. Revisit this and look for alternatives.

Causes one or more values in the executor to get disposed of (no longer available for future calls).

Execute

View source

Execute(
    request_iter,
    context
)

Establishes a bidirectional stream with an Executor instance.