diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-10-09 16:53:29 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-10-09 17:06:10 -0700 |
commit | bb5fc614a4a358b350ef8dd19cb7010760fa9b29 (patch) | |
tree | 43a745ffdc409d0ff4660342d6a62735ac366a13 /tensorflow/compiler/xla/service/allocation_tracker.cc | |
parent | 65b7d0b2f84c334327a295bf41bc06c7f6b8ffe5 (diff) |
[XLA] Cleanup: Make AllocationTracker::Resolve const.
So that when resolving some global data, we don't have to worry whether
"Resolve" is going to mutate the real data.
PiperOrigin-RevId: 216448145
Diffstat (limited to 'tensorflow/compiler/xla/service/allocation_tracker.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/allocation_tracker.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/allocation_tracker.cc b/tensorflow/compiler/xla/service/allocation_tracker.cc index 1ed6142dce..ef5e211646 100644 --- a/tensorflow/compiler/xla/service/allocation_tracker.cc +++ b/tensorflow/compiler/xla/service/allocation_tracker.cc @@ -176,13 +176,13 @@ StatusOr<std::vector<GlobalDataHandle>> AllocationTracker::DeconstructTuple( } StatusOr<std::vector<const ShapedBuffer*>> AllocationTracker::Resolve( - const GlobalDataHandle& data) { + const GlobalDataHandle& data) const { tensorflow::mutex_lock lock(mutex_); return AllocationTracker::ResolveInternal(data); } StatusOr<const ShapedBuffer*> AllocationTracker::ResolveForReplica( - const GlobalDataHandle& data, int replica_id) { + const GlobalDataHandle& data, int replica_id) const { tensorflow::mutex_lock lock(mutex_); TF_ASSIGN_OR_RETURN(std::vector<const ShapedBuffer*> replicated_buffers, ResolveInternal(data)); @@ -196,7 +196,7 @@ StatusOr<const ShapedBuffer*> AllocationTracker::ResolveForReplica( } StatusOr<std::vector<const ShapedBuffer*>> AllocationTracker::ResolveInternal( - const GlobalDataHandle& data) { + const GlobalDataHandle& data) const { VLOG(2) << "resolve:" << data.handle(); auto it = handle_to_shaped_buffers_.find(data.handle()); if (it == handle_to_shaped_buffers_.end()) { |