tf_1.8_xla_doc
Public Member Functions | Private Member Functions | List of all members
xla::ComputationBuilder Class Reference

#include <computation_builder.h>

Collaboration diagram for xla::ComputationBuilder:
[legend]

Public Member Functions

ComputationDataHandle Parameter (int64 parameter_number, const Shape &shape, const string &name)
 Enqueues a "retrieve parameter value" instruction to the UserComputation. More...
 

Private Member Functions

Status PrepareComputation ()
 Populates computation_ with a valid object. Used before any given operation is enqueued. More...
 
Status RunOp (OpRequest *op_request, OpResponse *op_response)
 Run the given parameter op_request and fill in op_response. More...
 
ComputationDataHandle RunOpAndParseResponse (OpRequest *op_request)
 Call RunOp() and either return the output ComputationDataHandle (on success) or an empty ComputationDataHandle (on failure). More...
 

Detailed Description

ComputationBuilder

Member Function Documentation

◆ Parameter()

ComputationDataHandle xla::ComputationBuilder::Parameter ( int64  parameter_number,
const Shape &  shape,
const string &  name 
)

Enqueues a "retrieve parameter value" instruction to the UserComputation.

  1. Prepare OpRequest object and call the method RunOpAndParseResponse().
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareComputation()

Status xla::ComputationBuilder::PrepareComputation ( )
private

Populates computation_ with a valid object. Used before any given operation is enqueued.

  1. Check existence of stub service.
  2. Prepare ComputationRequest & ComputationResponse objects
  3. Use the service recorded in client_ to make computation.
  4. Use the result of step 3 to make a Computation object and store in member computation_

Unclear parts:

  1. Check on line 65
Here is the caller graph for this function:

◆ RunOp()

Status xla::ComputationBuilder::RunOp ( OpRequest *  op_request,
OpResponse *  op_response 
)
private

Run the given parameter op_request and fill in op_response.

  1. Call PrepareComputation() to populate member computation_ with a valid object.
  2. Set the given argument op_request (computation handle, metadata, sharding).
  3. Use client_ to call service's method Op()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunOpAndParseResponse()

ComputationDataHandle xla::ComputationBuilder::RunOpAndParseResponse ( OpRequest *  op_request)
private

Call RunOp() and either return the output ComputationDataHandle (on success) or an empty ComputationDataHandle (on failure).

  1. Prepare OpResponse object to record the result and Call RunOp().
  2. Record errors if any (error handling is postponsed to method Build())
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: