diff options
author | Olivia Nordquist <nolivia@google.com> | 2017-07-18 11:34:24 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-07-18 11:40:59 -0700 |
commit | 9867119831afa821aa53206cc5b7ae773db4284d (patch) | |
tree | a50ffe4e4e06d8b932721b7d501c39e7b3c6b559 /tensorflow/c/python_api.cc | |
parent | 1558c10c8d07c78a58d74d0fcf53c1d2e2505d5e (diff) |
Implementing set_device for the C API
PiperOrigin-RevId: 162379684
Diffstat (limited to 'tensorflow/c/python_api.cc')
-rw-r--r-- | tensorflow/c/python_api.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/c/python_api.cc b/tensorflow/c/python_api.cc index 91e4e3cbb9..adca6c7625 100644 --- a/tensorflow/c/python_api.cc +++ b/tensorflow/c/python_api.cc @@ -25,4 +25,9 @@ void AddControlInput(TF_Graph* graph, TF_Operation* op, TF_Operation* input) { graph->graph.AddControlEdge(&input->node, &op->node); } +void SetRequestedDevice(TF_Graph* graph, TF_Operation* op, const char* device) { + mutex_lock l(graph->mu); + op->node.set_requested_device(device); +} + } // namespace tensorflow |