diff options
author | 2017-02-28 22:09:13 -0800 | |
---|---|---|
committer | 2017-02-28 22:28:41 -0800 | |
commit | ccf9a752f9f10cbee2f4f53b0d46a5951d620922 (patch) | |
tree | 4e9d2760d9505bc527b6587bd1f5879444e8ea0c /tensorflow/contrib/memory_stats/ops | |
parent | 8777d9a15614b65271d25401f488b70b6b3dca1e (diff) |
Add new ops for memory statistics.
This CL adds only the MaxBytesInUse op, which collects the peak memory usage of
a device allocator. Other ops can be added similarly when demanded. For now, we
only enable MaxBytesInUse for GPU because memory statistics are unreliable for
CPU allocators.
This CL essentially merges part of Yaroslav Bulatov's work on
https://github.com/yaroslavvb/memory_probe_ops to TensorFlow.
Change: 148854571
Diffstat (limited to 'tensorflow/contrib/memory_stats/ops')
-rw-r--r-- | tensorflow/contrib/memory_stats/ops/memory_stats_ops.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tensorflow/contrib/memory_stats/ops/memory_stats_ops.cc b/tensorflow/contrib/memory_stats/ops/memory_stats_ops.cc new file mode 100644 index 0000000000..cdca15388a --- /dev/null +++ b/tensorflow/contrib/memory_stats/ops/memory_stats_ops.cc @@ -0,0 +1,21 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ +#include "tensorflow/core/framework/op.h" + +namespace tensorflow { + +REGISTER_OP("MaxBytesInUse").Output("out: int64").SetIsStateful(); + +} // namespace tensorflow |