tf_1.8_xla_doc
Namespaces | Classes | Functions
tensorflow Namespace Reference

Namespaces

 tfcompile
 Namespace of tfcompile.
 

Classes

class  XlaCompiler
 
class  XlaOpRegistry
 

Functions

Status ConvertGraphDefToXla (const GraphDef &graph_def, const tf2xla::Config &config, xla::Client *client, xla::Computation *computation)
 Convert tensorflow graph_def to XLA UserComputation. More...
 
Status ValidateConfig (const tf2xla::Config &config)
 
Status AddPlaceholdersForFeeds (const tf2xla::Config &config, const OpRegistryInterface *op_registry, std::unordered_map< string, string > *feed_remapping, GraphDef *graph_def)
 Generate corresponding placeholder for each feed tensor. Traverse each inputs of each nodes. Replace feeds to corresponding placeholders. More...
 
Status PruneGraphDefInto (const tf2xla::Config &config, const GraphDef &in, GraphDef *out)
 Remove source nodes of feed tensor. Because they are removed at tensorflow::AddPlaceholdersForFeeds More...
 
Status AddDefaultAttrsToGraphDef (GraphDef *graph_def, const OpRegistryInterface &op_registry, int node_offset)
 Assign each NodeDefs of GraphDef default values. More...
 
Status ConvertGraphDefToGraph (const GraphConstructorOptions &opts, const GraphDef &gdef, Graph *g)
 Convert GraphDef defined protobuf to type Graph More...
 

Detailed Description

Namespace of tensorflow

namespace of tensorflow

Function Documentation

◆ AddDefaultAttrsToGraphDef()

Status tensorflow::AddDefaultAttrsToGraphDef ( GraphDef *  graph_def,
const OpRegistryInterface &  op_registry,
int  node_offset 
)

Assign each NodeDefs of GraphDef default values.

Google Docs:

Adds default attributes to NodeDefs in 'graph_def' starting from the 'node_offset' node in 'graph_def'.

Default attributes are defined by 'op_registry'.

Returns OK on success, an error if 'graph_def' has a NodeDef that cannot be found in 'op_registry'.

REQUIRES: 'graph_def' and 'op_registry' are not nullptr.

Here is the caller graph for this function:

◆ AddPlaceholdersForFeeds()

Status tensorflow::AddPlaceholdersForFeeds ( const tf2xla::Config &  config,
const OpRegistryInterface *  op_registry,
std::unordered_map< string, string > *  feed_remapping,
GraphDef *  graph_def 
)

Generate corresponding placeholder for each feed tensor. Traverse each inputs of each nodes. Replace feeds to corresponding placeholders.

Modifies <graph_def> to include placeholders for each fed tensor, and update references to the fed tensors to refer to the placeholders. The existing nodes referenced by the feeds are not removed or modified (except where their input edges are modified by the replacement of other feeds).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertGraphDefToGraph()

Status tensorflow::ConvertGraphDefToGraph ( const GraphConstructorOptions &  opts,
const GraphDef &  gdef,
Graph *  g 
)

Convert GraphDef defined protobuf to type Graph

As brief

Here is the caller graph for this function:

◆ ConvertGraphDefToXla()

Status tensorflow::ConvertGraphDefToXla ( const GraphDef &  graph_def,
const tf2xla::Config &  config,
xla::Client *  client,
xla::Computation *  computation 
)

Convert tensorflow graph_def to XLA UserComputation.

  1. Call tensorflow::anonymous_namespace{tf2xla.cc}::InitGraph
  2. Call tensorflow::anonymous_namespace{tf2xla.cc}::ConvertGraphToXla
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PruneGraphDefInto()

Status tensorflow::PruneGraphDefInto ( const tf2xla::Config &  config,
const GraphDef &  in,
GraphDef *  out 
)

Remove source nodes of feed tensor. Because they are removed at tensorflow::AddPlaceholdersForFeeds

Returns in <out> a copy of <in>, pruned to only include fetches from <config>.

Here is the caller graph for this function:

◆ ValidateConfig()

Status tensorflow::ValidateConfig ( const tf2xla::Config &  config)

Check settings of input config(feed & fetch). For example, if id, shape are legal, duplicated names...

Here is the caller graph for this function: