Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch 145436800 #7043

Merged
merged 122 commits into from Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
5c8fc64
[XLA] Move ProgramShape creation utility from HloTestBase by an exist…
eliben Jan 19, 2017
3a4849e
Automated rollback of change 144922485
davidsoergel Jan 19, 2017
94f2508
Improve the performance of CPU assignment for strings. Very large inc…
tensorflower-gardener Jan 19, 2017
b452d1c
StreamExecutor param to specify cuDNN or TF padding
tensorflower-gardener Jan 19, 2017
6bbd60c
Change for internal compatibility.
tensorflower-gardener Jan 19, 2017
6149fc5
Don't remove send, recv, or trace instructions in DCE pass. Also,
meheffernan Jan 19, 2017
cce954b
Ensure all structs in the C API are named (in addition to typedef'd).
skye Jan 19, 2017
9dc9c06
Change for internal compatibility.
tensorflower-gardener Jan 19, 2017
c44cde1
[TF:XLA] Add support for compiling computations with no return values.
hawkinsp Jan 19, 2017
69b8051
A canned Estimator for state saving RNNs.
tensorflower-gardener Jan 19, 2017
a111858
Change RewriteGraphForExecution to propagate an _output_shapes annota…
hawkinsp Jan 19, 2017
3f45361
Expose the two constants that control GPU Event polling pacing as
tensorflower-gardener Jan 19, 2017
7e935c1
Rename head_ops to create_model_fn_ops.
tensorflower-gardener Jan 19, 2017
f49721a
Enabling the GPU version of the stage ops.
zheng-xq Jan 19, 2017
82542b6
Addition of platform-specific key-value options to StreamExecutor Dev…
tensorflower-gardener Jan 19, 2017
598583c
Add convolve quantized ops to StreamExecutor API
tensorflower-gardener Jan 19, 2017
14c20c7
Fix Python 3 compatibility bug in test
davidsoergel Jan 19, 2017
acacd3f
Fixed followings in LoggingTensorHook:
ispirmustafa Jan 19, 2017
2abeb0f
Add control successors to HloInstruction. Add Send/Recv cases for the
hyouklee Jan 19, 2017
29e8d98
Create a fast path for direct session executor lookup to avoid sortin…
Jan 19, 2017
c5dfb0f
Better document label_dimension and logits_dimension args.
tensorflower-gardener Jan 19, 2017
fa82a88
Update generated Python Op docs.
tensorflower-gardener Jan 19, 2017
f736991
Python wrapper for the Graph Transform Tool
petewarden Jan 19, 2017
a7b60a8
Add hooks for StreamExecutor module initialization ordering
tensorflower-gardener Jan 19, 2017
901f650
BREAKING CHANGE: Rename instances of "std" to "stddev".
jvdillon Jan 19, 2017
a494308
Change distributions is_reparameterized bool to reparameterization_ty…
ebrevdo Jan 19, 2017
8459beb
Update generated Python Op docs.
tensorflower-gardener Jan 19, 2017
5c994b2
Allow HashTableOP to map int64 to int64.
ysuematsu Jan 19, 2017
d291f36
Update LLVM version to r292413.
Jan 19, 2017
f75618b
Automated rollback of change 141461172
lilao Jan 19, 2017
ff50cae
Minor clarification for docs.
tensorflower-gardener Jan 20, 2017
135729a
Windows: Attempt to fix #6931
asimshankar Jan 20, 2017
75c2f4f
Change image random flip ops, and flip_left_right, to use tf.reverse.
tensorflower-gardener Jan 20, 2017
c7b5900
Update generated Python Op docs.
tensorflower-gardener Jan 20, 2017
65d8616
LinearOperatorUDVH Added to contrib/linalg/
langmore Jan 20, 2017
3853ec3
s/android_cpu/cpu/ in tensorflow/BUILD config_setting entries to remo…
andrewharp Jan 20, 2017
7deaef8
Update generated Python Op docs.
tensorflower-gardener Jan 20, 2017
0bff404
Fix test names.
tensorflower-gardener Jan 20, 2017
c17926a
Updating Estimators tutorial to use ModelFnOps (with an example of ev…
sandersk Jan 20, 2017
fc66eab
Automated rollback of change 144966157
davidsoergel Jan 20, 2017
4e754a6
Clarified ambiguous documentation on sparse_column_with_integerized_f…
tensorflower-gardener Jan 20, 2017
841e899
Made the chart scaffold discount data responses that are outdated. Ot…
tensorflower-gardener Jan 20, 2017
fa55a5f
Don't throw error on generic default signature, rather print an error…
tensorflower-gardener Jan 20, 2017
4a070c0
Bugfix: StudentT distribution is not reparameterizable.
ebrevdo Jan 20, 2017
f766248
Update generated Python Op docs.
tensorflower-gardener Jan 20, 2017
d5017d3
Remove unused properties from Experiment.
Jan 20, 2017
d3e3314
Force new instance creation in MultiRNNCell
ebrevdo Jan 20, 2017
a20cfa5
Force new instance creation in MultiRNNCell
ebrevdo Jan 20, 2017
ffc60f1
Use `keep_input` to prevent expensive storing of sparse tensor in buc…
tensorflower-gardener Jan 20, 2017
edb38e4
Update generated Python Op docs.
tensorflower-gardener Jan 20, 2017
c7dc0af
tfdbg: minor change to debug_fibonacci example
caisq Jan 20, 2017
f6d9014
Force new instance creation in MultiRNNCell
ebrevdo Jan 20, 2017
1b71d25
Propagate TF_BUILD_ENABLE_XLA environment variable into the CI build …
hawkinsp Jan 20, 2017
8499dc1
Go: Support DT_BOOL tensors.
asimshankar Jan 20, 2017
448c0dc
Fix the bug that when cpu_allocated is called before session initiali…
Jan 20, 2017
45208ae
Avoid opening multiple servers in the same test where possible.
mrry Jan 20, 2017
c312943
Better StreamExecutor constructor
tensorflower-gardener Jan 20, 2017
0faa2a4
[XLA] TODO(b/n) rather than TODO(user), NFC
tensorflower-gardener Jan 20, 2017
142f24e
Java: Remove {@link}s from package-info.java
asimshankar Jan 20, 2017
47bd971
[XLA] Make capture lists in `ElementalIrEmitter::MakeElementGenerator…
tensorflower-gardener Jan 20, 2017
e37496e
tfdbg: fix a bug in run_info command handler + some cleanup
caisq Jan 20, 2017
06d8cf0
Refactor GMM algorithm to use canned estimator.
tensorflower-gardener Jan 20, 2017
2b0fbdd
Work around Devsite bug in generated documentation.
skye Jan 20, 2017
ba9e992
Adding note that Layers tutorial requires TF 1.0
sandersk Jan 20, 2017
fac4a35
Delete namespace aliases in tensorflow::ops for Input,
tensorflower-gardener Jan 20, 2017
177684c
[TF:XLA] Make //tensorflow/compiler/tests:concat_ops_test medium size…
hawkinsp Jan 20, 2017
bb71ec0
Expose more ImportGraphDef functionality in the C API.
skye Jan 20, 2017
3ecafa3
Add default ScopedDeviceMemory ctor in StreamExecutor
tensorflower-gardener Jan 20, 2017
0124bf5
Update ops-related pbtxt files.
tensorflower-gardener Jan 20, 2017
fe5d674
Remove the -march=native copt from Android Makefile builds, as the ND…
andrewharp Jan 20, 2017
04598be
Added a slider beneath image summaries within Tensorboard's images pa…
tensorflower-gardener Jan 20, 2017
8d240de
Fix bug instroduced by cl/145035853, only call report_benchmark once …
tensorflower-gardener Jan 20, 2017
723c404
FileSystem directory creation fixes:
Jan 21, 2017
44042c8
Add space_to_batch and batch_to_space ops to android_extended_ops_gro…
tensorflower-gardener Jan 21, 2017
6e49224
LogMesssage now includes a timestamp as beginning of a message.
Jan 21, 2017
2faf36f
Internal-only changes
caisq Jan 21, 2017
cf4e772
Refactor TensorBoard into WSGI application. Adds werkzeug pip depend…
Jan 21, 2017
3117a10
Add utilities that deal with shallow structures.
adria-p Jan 21, 2017
4fe280c
Added optional string argument to infeed HLO op.
tensorflower-gardener Jan 21, 2017
043e623
Extend the functionality of `maybe_*batch` to act on elements in a mi…
tensorflower-gardener Jan 22, 2017
3dd2631
Update generated Python Op docs.
tensorflower-gardener Jan 22, 2017
6c7f605
Fix windows compilation of env_time.cc
gunan Jan 22, 2017
24e0b3c
Fix bug introduced in cl/145211380 and add unit tests that would have…
tensorflower-gardener Jan 22, 2017
8cf38e8
Don't use SO_REUSEPORT in TensorFlow servers.
mrry Jan 23, 2017
6b8f7d6
Extends subscribe syntax to allow side effects to be added to subscri…
tensorflower-gardener Jan 23, 2017
ef896d3
Add a helper method Node::input_edges() that populates a vector of al…
hawkinsp Jan 23, 2017
8a8c9a1
[XLA] Replace TODO(name) by TODO(b/...)
eliben Jan 23, 2017
6136efa
Change the way to mutate the export strategies.
Jan 23, 2017
db69f2e
Add a sub makefile to generate so file
tensorflower-gardener Jan 23, 2017
164909a
Docs: Specifically call out "deprecated" and "experimental" APIs in the
asimshankar Jan 23, 2017
53bdaa9
Handle non-tensor args.
tensorflower-gardener Jan 23, 2017
c22719d
[XLA:GPU] Do not merge fusion instructions with expensive fused instr…
tensorflower-gardener Jan 23, 2017
0f4ee80
Added graph transform tool to cmake to fix Windows build
petewarden Jan 23, 2017
756f60d
Add support for logits_inputs.
tensorflower-gardener Jan 23, 2017
503c0d4
Disable two failing tensorboard tests in cmake build in windows.
gunan Jan 23, 2017
30d5f6f
Update generated Python Op docs.
tensorflower-gardener Jan 23, 2017
6b2e92e
Ensure device_lib_test only runs GPU code when a GPU is available.
Jan 23, 2017
b2ba712
Add Makefile build to android.sh for better presubmit build coverage.
andrewharp Jan 23, 2017
5db32c9
Split GPU tile ops into multiple files.
tensorflower-gardener Jan 24, 2017
5aed362
Improve support for pad instructions with negative padding.
meheffernan Jan 24, 2017
9b7c47c
Enable inplace update ops for strings on CPU. Speed up string concat.
tensorflower-gardener Jan 24, 2017
cd4a964
Java: Provide the Java API in the Android inference library.
asimshankar Jan 24, 2017
3b4e53b
Add an options argument to EqualGraphDef and EqualNodeDef. Currently …
hawkinsp Jan 24, 2017
56fc883
Merge changes from github.
caisq Jan 24, 2017
6a76cf3
Update generated Python Op docs.
tensorflower-gardener Jan 24, 2017
43a0c04
Added eight-bit version of multiply operation
petewarden Jan 24, 2017
698766e
Update ops-related pbtxt files.
tensorflower-gardener Jan 24, 2017
a544628
Update libxsmm version to 1.6.6.
tensorflower-gardener Jan 24, 2017
863bab3
Improvements to HLO text format printing.
broune Jan 24, 2017
67c4e3d
Fixes for python 3 tests:
gunan Jan 24, 2017
feb0553
BUGFIX: Bijector.forward_log_det_jacobian was mathematically incorrect.
langmore Jan 24, 2017
4edefff
Update generated Python Op docs.
tensorflower-gardener Jan 24, 2017
db9501a
Expose the ability to set a random seed for read_batch_examples().
tensorflower-gardener Jan 24, 2017
0e85801
Update generated Python Op docs.
tensorflower-gardener Jan 24, 2017
9dbe4fe
Automated rollback of change 145343019
gunan Jan 24, 2017
0b0430d
Remove files that are moved.
gunan Jan 24, 2017
5ec1c90
[XLA] Replace std::mutex & std::condition_variable by TF equivalents
eliben Jan 24, 2017
7f79424
Disallow gradients of complex tensors unless grad_ys is set
girving Jan 24, 2017
eb65eff
Add options argument for DNN activation
tensorflower-gardener Jan 24, 2017
a2762e4
[XLA] Add test for ReduceWindow with an uncommon reduce function.
hawkinsp Jan 24, 2017
d1cc162
Fix: Rename the reference to http_test in tf_tests.cmake.
gunan Jan 24, 2017
5648dea
Merge commit for internal changes
gunan Jan 24, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions RELEASE.md
Expand Up @@ -59,6 +59,8 @@
behavior by specifying the attribute dct_method='INTEGER_ACCURATE'.
* `tf.complex_abs` has been removed from the Python interface. `tf.abs`
supports complex tensors and should be used instead.
* In the C++ API (in tensorflow/cc), Input, Output, etc. have moved
from the tensorflow::ops namespace to tensorflow.

# Release 0.12.0

Expand Down
4 changes: 2 additions & 2 deletions tensorflow/BUILD
Expand Up @@ -24,7 +24,7 @@ config_setting(
name = "android_arm",
values = {
"crosstool_top": "//external:android/crosstool",
"android_cpu": "armeabi-v7a",
"cpu": "armeabi-v7a",
},
visibility = ["//visibility:public"],
)
Expand All @@ -33,7 +33,7 @@ config_setting(
name = "android_arm64",
values = {
"crosstool_top": "//external:android/crosstool",
"android_cpu": "arm64-v8a",
"cpu": "arm64-v8a",
},
visibility = ["//visibility:public"],
)
Expand Down
73 changes: 65 additions & 8 deletions tensorflow/c/c_api.cc
Expand Up @@ -76,6 +76,7 @@ using tensorflow::SessionOptions;
using tensorflow::Status;
using tensorflow::Tensor;
using tensorflow::TensorBuffer;
using tensorflow::TensorId;
using tensorflow::TensorShape;
using tensorflow::TensorShapeProto;

Expand Down Expand Up @@ -1667,30 +1668,86 @@ void TF_ImportGraphDefOptionsSetPrefix(TF_ImportGraphDefOptions* opts,
opts->opts.prefix = prefix;
}

namespace {

TensorId ToTensorId(const TF_Output& output) {
return TensorId(output.oper->node.name(), output.index);
}

} // namespace

void TF_ImportGraphDefOptionsAddInputMapping(TF_ImportGraphDefOptions* opts,
const char* src_name,
int src_index, TF_Output dst) {
opts->opts.input_map[TensorId(src_name, src_index)] = ToTensorId(dst);
}

extern void TF_ImportGraphDefOptionsAddControlDependency(
TF_ImportGraphDefOptions* opts, TF_Operation* oper) {
opts->opts.control_dependencies.push_back(oper->node.name());
}

void TF_ImportGraphDefOptionsAddReturnOutput(TF_ImportGraphDefOptions* opts,
const char* oper_name, int index) {
opts->opts.return_tensors.push_back({oper_name, index});
}

int TF_ImportGraphDefOptionsNumReturnOutputs(
const TF_ImportGraphDefOptions* opts) {
return opts->opts.return_tensors.size();
}

static void GraphImportGraphDefLocked(TF_Graph* graph, const GraphDef& def,
const TF_ImportGraphDefOptions* opts,
TF_Status* status)
TF_Output* return_outputs,
int num_return_outputs, TF_Status* status)
EXCLUSIVE_LOCKS_REQUIRED(graph->mu) {
if (num_return_outputs != opts->opts.return_tensors.size()) {
status->status = InvalidArgument("Expected 'num_return_outputs' to be ",
opts->opts.return_tensors.size(), ", got ",
num_return_outputs);
return;
}
if (num_return_outputs > 0 && return_outputs == nullptr) {
status->status = InvalidArgument(
"'return_outputs' must be preallocated to length ", num_return_outputs);
return;
}
const int last_node_id = graph->graph.num_node_ids();
status->status = tensorflow::ImportGraphDef(opts->opts, def, &graph->graph,
&graph->refiner);
std::vector<std::pair<Node*, int>> return_outputs_vec;
status->status = tensorflow::ImportGraphDef(
opts->opts, def, &graph->graph, &graph->refiner, &return_outputs_vec);
if (!status->status.ok()) return;
for (int i = last_node_id; i < graph->graph.num_node_ids(); ++i) {
auto* node = graph->graph.FindNodeId(i);
if (node != nullptr) graph->name_map[node->name()] = node;
}
DCHECK_EQ(return_outputs_vec.size(), num_return_outputs);
for (int i = 0; i < num_return_outputs; ++i) {
return_outputs[i].oper = ToOperation(return_outputs_vec[i].first);
return_outputs[i].index = return_outputs_vec[i].second;
}
}

void TF_GraphImportGraphDef(TF_Graph* graph, const TF_Buffer* graph_def,
const TF_ImportGraphDefOptions* opts,
TF_Status* status) {
void TF_GraphImportGraphDefWithReturnOutputs(
TF_Graph* graph, const TF_Buffer* graph_def,
const TF_ImportGraphDefOptions* opts, TF_Output* return_outputs,
int num_return_outputs, TF_Status* status) {
GraphDef def;
if (!def.ParseFromArray(graph_def->data, graph_def->length)) {
status->status = InvalidArgument("Invalid GraphDef");
return;
}
mutex_lock l(graph->mu);
GraphImportGraphDefLocked(graph, def, opts, status);
GraphImportGraphDefLocked(graph, def, opts, return_outputs,
num_return_outputs, status);
}

void TF_GraphImportGraphDef(TF_Graph* graph, const TF_Buffer* graph_def,
const TF_ImportGraphDefOptions* options,
TF_Status* status) {
TF_GraphImportGraphDefWithReturnOutputs(graph, graph_def, options, nullptr, 0,
status);
}

// TF_Session functions ----------------------------------------------
Expand Down Expand Up @@ -1750,7 +1807,7 @@ TF_Session* TF_LoadSessionFromSavedModel(
// GraphDefs, return the Graph generated in LoadSavedModel().
TF_ImportGraphDefOptions* import_opts = TF_NewImportGraphDefOptions();
GraphImportGraphDefLocked(graph, bundle.meta_graph_def.graph_def(),
import_opts, status);
import_opts, nullptr, 0, status);
TF_DeleteImportGraphDefOptions(import_opts);
if (TF_GetCode(status) != TF_OK) return nullptr;

Expand Down
39 changes: 37 additions & 2 deletions tensorflow/c/c_api.h
Expand Up @@ -160,7 +160,7 @@ extern const char* TF_Message(const TF_Status* s);
// By default, TF_Buffer itself does not do any memory management of the
// pointed-to block. If need be, users of this struct should specify how to
// deallocate the block by setting the `data_deallocator` function pointer.
typedef struct {
typedef struct TF_Buffer {
const void* data;
size_t length;
void (*data_deallocator)(void* data, size_t length);
Expand Down Expand Up @@ -594,7 +594,7 @@ typedef enum {
} TF_AttrType;

// TF_AttrMetadata describes the value of an attribute on an operation.
typedef struct {
typedef struct TF_AttrMetadata {
// A boolean: 1 if the attribute value is a list, 0 otherwise.
unsigned char is_list;

Expand Down Expand Up @@ -801,7 +801,42 @@ extern void TF_DeleteImportGraphDefOptions(TF_ImportGraphDefOptions* opts);
extern void TF_ImportGraphDefOptionsSetPrefix(TF_ImportGraphDefOptions* opts,
const char* prefix);

// Set any imported nodes with input `src_name:src_index` to have that input
// replaced with `dst`. `src_name` refers to a node in the graph to be imported,
// `dst` references a node already existing in the graph being imported into.
extern void TF_ImportGraphDefOptionsAddInputMapping(
TF_ImportGraphDefOptions* opts, const char* src_name, int src_index,
TF_Output dst);

// Cause the imported graph to have a control dependency on `oper`. `oper`
// should exist in the graph being imported into.
extern void TF_ImportGraphDefOptionsAddControlDependency(
TF_ImportGraphDefOptions* opts, TF_Operation* oper);

// Add an output in `graph_def` to be returned via the `return_outputs` output
// parameter of TF_GraphImportGraphDef(). If the output is remapped via an input
// mapping, the corresponding existing tensor in `graph` will be returned.
extern void TF_ImportGraphDefOptionsAddReturnOutput(
TF_ImportGraphDefOptions* opts, const char* oper_name, int index);

// Returns the number of return outputs added via
// TF_ImportGraphDefOptionsAddReturnOutput().
extern int TF_ImportGraphDefOptionsNumReturnOutputs(
const TF_ImportGraphDefOptions* opts);

// Import the graph serialized in `graph_def` into `graph`.
//
// `num_return_outputs` must be the number of return outputs added (i.e. the
// result of TF_ImportGraphDefOptionsNumReturnOutputs()). If
// `num_return_outputs` is non-zero, `return_outputs` must be of length
// `num_return_outputs`. Otherwise it can be null.
extern void TF_GraphImportGraphDefWithReturnOutputs(
TF_Graph* graph, const TF_Buffer* graph_def,
const TF_ImportGraphDefOptions* options, TF_Output* return_outputs,
int num_return_outputs, TF_Status* status);

// Import the graph serialized in `graph_def` into `graph`.
// Convenience function for when no return outputs have been added.
extern void TF_GraphImportGraphDef(TF_Graph* graph, const TF_Buffer* graph_def,
const TF_ImportGraphDefOptions* options,
TF_Status* status);
Expand Down
76 changes: 72 additions & 4 deletions tensorflow/c/c_api_test.cc
Expand Up @@ -675,9 +675,12 @@ TEST(CAPI, ImportGraphDef) {
Placeholder(graph, s);
ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
ASSERT_TRUE(TF_GraphOperationByName(graph, "feed") != nullptr);
ScalarConst(3, graph, s);
TF_Operation* oper = ScalarConst(3, graph, s);
ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
ASSERT_TRUE(TF_GraphOperationByName(graph, "scalar") != nullptr);
Neg(oper, graph, s);
ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);
ASSERT_TRUE(TF_GraphOperationByName(graph, "neg") != nullptr);

// Export to a GraphDef
TF_Buffer* graph_def = TF_NewBuffer();
Expand All @@ -692,13 +695,78 @@ TEST(CAPI, ImportGraphDef) {
TF_GraphImportGraphDef(graph, graph_def, opts, s);
ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);

TF_DeleteImportGraphDefOptions(opts);
TF_DeleteBuffer(graph_def);

TF_Operation* scalar = TF_GraphOperationByName(graph, "imported/scalar");
TF_Operation* feed = TF_GraphOperationByName(graph, "imported/feed");
TF_Operation* neg = TF_GraphOperationByName(graph, "imported/neg");
ASSERT_TRUE(scalar != nullptr);
ASSERT_TRUE(feed != nullptr);
ASSERT_TRUE(neg != nullptr);

// Import it again, with an input mapping and return outputs, into the same
// graph.
TF_DeleteImportGraphDefOptions(opts);
opts = TF_NewImportGraphDefOptions();
TF_ImportGraphDefOptionsSetPrefix(opts, "imported2");
TF_ImportGraphDefOptionsAddInputMapping(opts, "scalar", 0, {scalar, 0});
TF_ImportGraphDefOptionsAddReturnOutput(opts, "feed", 0);
TF_ImportGraphDefOptionsAddReturnOutput(opts, "scalar", 0);
EXPECT_EQ(2, TF_ImportGraphDefOptionsNumReturnOutputs(opts));
TF_Output return_outputs[2];
TF_GraphImportGraphDefWithReturnOutputs(graph, graph_def, opts,
return_outputs, 2, s);
ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);

TF_Operation* scalar2 = TF_GraphOperationByName(graph, "imported2/scalar");
TF_Operation* feed2 = TF_GraphOperationByName(graph, "imported2/feed");
TF_Operation* neg2 = TF_GraphOperationByName(graph, "imported2/neg");
ASSERT_TRUE(scalar2 != nullptr);
ASSERT_TRUE(feed2 != nullptr);
ASSERT_TRUE(neg2 != nullptr);

// Check input mapping
TF_Output neg_input = TF_OperationInput({neg, 0});
EXPECT_EQ(scalar, neg_input.oper);
EXPECT_EQ(0, neg_input.index);

// Check return outputs
EXPECT_EQ(feed2, return_outputs[0].oper);
EXPECT_EQ(0, return_outputs[0].index);
EXPECT_EQ(scalar, return_outputs[1].oper); // remapped
EXPECT_EQ(0, return_outputs[1].index);

// Import again, with control dependencies, into the same graph.
TF_DeleteImportGraphDefOptions(opts);
opts = TF_NewImportGraphDefOptions();
TF_ImportGraphDefOptionsSetPrefix(opts, "imported3");
TF_ImportGraphDefOptionsAddControlDependency(opts, feed);
TF_ImportGraphDefOptionsAddControlDependency(opts, feed2);
TF_GraphImportGraphDef(graph, graph_def, opts, s);
ASSERT_EQ(TF_OK, TF_GetCode(s)) << TF_Message(s);

TF_Operation* scalar3 = TF_GraphOperationByName(graph, "imported3/scalar");
TF_Operation* feed3 = TF_GraphOperationByName(graph, "imported3/feed");
TF_Operation* neg3 = TF_GraphOperationByName(graph, "imported3/neg");
ASSERT_TRUE(scalar3 != nullptr);
ASSERT_TRUE(feed3 != nullptr);
ASSERT_TRUE(neg3 != nullptr);

// Check that newly-imported scalar and feed have control deps (neg3 will
// inherit them from input)
TF_Operation* control_inputs[100];
int num_control_inputs = TF_OperationGetControlInputs(
scalar3, control_inputs, TF_OperationNumControlInputs(scalar3));
ASSERT_EQ(2, num_control_inputs);
EXPECT_EQ(feed, control_inputs[0]);
EXPECT_EQ(feed2, control_inputs[1]);

num_control_inputs = TF_OperationGetControlInputs(
feed3, control_inputs, TF_OperationNumControlInputs(feed3));
ASSERT_EQ(2, num_control_inputs);
EXPECT_EQ(feed, control_inputs[0]);
EXPECT_EQ(feed2, control_inputs[1]);

TF_DeleteImportGraphDefOptions(opts);
TF_DeleteBuffer(graph_def);

// Can add nodes to the imported graph without trouble.
Add(feed, scalar, graph, s);
Expand Down
7 changes: 5 additions & 2 deletions tensorflow/cc/client/client_session.cc
Expand Up @@ -32,8 +32,11 @@ ClientSession::ClientSession(const Scope& scope) : ClientSession(scope, "") {}

ClientSession::ClientSession(const Scope& scope,
const SessionOptions& session_options)
: session_(NewSession(session_options)),
graph_(scope.graph_as_shared_ptr()) {
: graph_(scope.graph_as_shared_ptr()) {
Session* new_session;
Status status = NewSession(session_options, &new_session);
TF_CHECK_OK(status) << status;
session_.reset(new_session);
CHECK_NOTNULL(session_.get());
}

Expand Down
13 changes: 0 additions & 13 deletions tensorflow/cc/framework/ops.h
Expand Up @@ -284,19 +284,6 @@ class InputList {
std::vector<Input> inputs_;
};

// These symbols used to live in the ops namespace, so we temporarily
// declare some aliases there. TODO(josh11b): Delete this!
namespace ops {

using ::tensorflow::Input;
using ::tensorflow::InputList;
using ::tensorflow::Operation;
using ::tensorflow::Output;
using ::tensorflow::OutputHash;
using ::tensorflow::OutputList;

} // namespace ops

} // namespace tensorflow

#endif // THIRD_PARTY_TENSORFLOW_CC_FRAMEWORK_OPS_H_
1 change: 0 additions & 1 deletion tensorflow/cc/saved_model/BUILD
Expand Up @@ -48,7 +48,6 @@ tf_cc_test(
":saved_model_half_plus_two",
],
linkstatic = 1,
tags = ["manual"],
deps = [
":constants",
":loader",
Expand Down
3 changes: 0 additions & 3 deletions tensorflow/compiler/jit/mark_for_compilation_pass.cc
Expand Up @@ -42,9 +42,6 @@ const char* const kXlaClusterAttr = "_XlaCluster";
namespace {

bool HasXLAKernel(const Node& node, const DeviceType& jit_device_type) {
// _Send and _Recv should not be marked for compilation.
if (node.IsSend() || node.IsRecv()) return false;

// There is a SymbolicGradient kernel on the XLA_JIT device, but the gradient
// is really a kind of function call and will be handled by
// IsCompilableCall().
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/compiler/jit/xla_device_ops.cc
Expand Up @@ -29,8 +29,8 @@ void XlaDeviceAssignOp::Copy(OpKernelContext* context, Tensor* lhs,
XlaDeviceDummyOp::XlaDeviceDummyOp(OpKernelConstruction* ctx) : OpKernel(ctx) {}

void XlaDeviceDummyOp::Compute(OpKernelContext* ctx) {
LOG(FATAL) << "Attempted to execute Op " << name() << "type " << type_string()
<< " on an XLA device. This should never happen.";
LOG(FATAL) << "Attempted to execute Op " << name() << " type "
<< type_string() << " on an XLA device. This should never happen.";
}

} // namespace tensorflow
2 changes: 1 addition & 1 deletion tensorflow/compiler/tests/BUILD
Expand Up @@ -70,7 +70,7 @@ tf_xla_py_test(

tf_xla_py_test(
name = "concat_ops_test",
size = "small",
size = "medium",
srcs = ["concat_ops_test.py"],
deps = [
":xla_test",
Expand Down