diff options
author | 2016-06-20 14:23:50 -0800 | |
---|---|---|
committer | 2016-06-20 15:34:22 -0700 | |
commit | 6fb0fe23a6cc015c7f37f53559abf5172687366e (patch) | |
tree | 4c8004386c8b060b731714d777f889904d027dea /tensorflow/core/kernels/range_sampler.cc | |
parent | 42496a147f5e3da17ea24f12bee51c6dfc0c66a5 (diff) |
Clean up callers of old Env:: APIs that don't pass unique_ptr.
Change: 125386366
Diffstat (limited to 'tensorflow/core/kernels/range_sampler.cc')
-rw-r--r-- | tensorflow/core/kernels/range_sampler.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tensorflow/core/kernels/range_sampler.cc b/tensorflow/core/kernels/range_sampler.cc index c2a7c14777..39a9fd37d2 100644 --- a/tensorflow/core/kernels/range_sampler.cc +++ b/tensorflow/core/kernels/range_sampler.cc @@ -277,11 +277,10 @@ void FixedUnigramSampler::FillReservedIds(int32 num_reserved_ids) { Status FixedUnigramSampler::LoadFromFile(Env* env, const string& vocab_file, float distortion) { - RandomAccessFile* file; + std::unique_ptr<RandomAccessFile> file; TF_RETURN_IF_ERROR(env->NewRandomAccessFile(vocab_file, &file)); - std::unique_ptr<RandomAccessFile> deleter(file); - io::InputBuffer in(file, 262144 /*bytes*/); + io::InputBuffer in(file.get(), 262144 /*bytes*/); string line; int32 word_id = weights_.size(); while (in.ReadLine(&line).ok()) { |