diff options
author | 2016-11-17 15:37:00 -0800 | |
---|---|---|
committer | 2016-11-17 15:45:18 -0800 | |
commit | 54e5000e0b980abe905900599c4493fadae34a15 (patch) | |
tree | c1f0751e5565882a77646589360fe090bec3f3fc /tensorflow/core/platform/setround.h | |
parent | 8a5610cd9f0b7087c1a7e97071ba1cf9b885315a (diff) |
Merge changes from github.
Change: 139516555
Diffstat (limited to 'tensorflow/core/platform/setround.h')
-rw-r--r-- | tensorflow/core/platform/setround.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tensorflow/core/platform/setround.h b/tensorflow/core/platform/setround.h new file mode 100644 index 0000000000..4b1b3fd497 --- /dev/null +++ b/tensorflow/core/platform/setround.h @@ -0,0 +1,38 @@ +/* Copyright 2015 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. +==============================================================================*/ + +#ifndef TENSORFLOW_PLATFORM_SETROUND_H_ +#define TENSORFLOW_PLATFORM_SETROUND_H_ + +#include "tensorflow/core/platform/macros.h" + +namespace tensorflow { +namespace port { + +// While this class is active, floating point numbers are rounded to NEAREST +// to zero. The destructor restores the original flags. +class ScopedSetRound { + public: + ScopedSetRound(); + ~ScopedSetRound(); + + private: + TF_DISALLOW_COPY_AND_ASSIGN(ScopedSetRound); +}; + +} // namespace port +} // namespace tensorflow + +#endif // TENSORFLOW_PLATFORM_SETROUN_H_ |