aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc/ops
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2016-06-16 18:04:10 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-06-16 19:16:41 -0700
commit209c006578483460e98c114a69d4b9ed6b95efed (patch)
tree0d0fa06e6472beea7291a2ea7bedc562e0a7f6dc /tensorflow/cc/ops
parent92753d80cf09efd6e9b9156e7ad08b3203214cec (diff)
TensorFlow: minor change functions in Env interface.
Switches to return a std::unique_ptr<> to convey transfer of ownership. Keeps existing functions temporarily for backwards compatibility. Change file_system.h interface to switch entirely to the new interface, change all callers. If this breaks someone in the public, the interface change should be straightforward. Change: 125127028
Diffstat (limited to 'tensorflow/cc/ops')
-rw-r--r--tensorflow/cc/ops/cc_op_gen.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/cc/ops/cc_op_gen.cc b/tensorflow/cc/ops/cc_op_gen.cc
index a6ca41ce38..d6cfccd6a9 100644
--- a/tensorflow/cc/ops/cc_op_gen.cc
+++ b/tensorflow/cc/ops/cc_op_gen.cc
@@ -305,8 +305,8 @@ string ToGuard(const std::string& path) {
void WriteCCOps(const OpList& ops, const std::string& dot_h_fname,
const std::string& dot_cc_fname) {
Env* env = Env::Default();
- WritableFile* h = nullptr;
- WritableFile* cc = nullptr;
+ std::unique_ptr<WritableFile> h;
+ std::unique_ptr<WritableFile> cc;
TF_CHECK_OK(env->NewWritableFile(dot_h_fname, &h));
TF_CHECK_OK(env->NewWritableFile(dot_cc_fname, &cc));
@@ -356,7 +356,7 @@ namespace ops {
TF_CHECK_OK(s);
for (const auto& op_def : ops.op()) {
- WriteCCOp(op_def, h, cc);
+ WriteCCOp(op_def, h.get(), cc.get());
}
// .h Footer