diff options
author | 2018-09-11 10:41:44 -0700 | |
---|---|---|
committer | 2018-09-11 10:51:01 -0700 | |
commit | 36e1a5ea5ba2dd5eaa7f4cfc84a61f8ce3ea20e1 (patch) | |
tree | 4f1671f78f5971b02dc2af66f57eabbf01005112 /tensorflow/core/platform | |
parent | 36d7b12357df667dcd427c070e21779ed83f4ec9 (diff) |
[TF] Variant improvements.
1. Change Variant Decode to accept VariantTensorData (non-ref).
This should allow some optimization in the future.
In the meantime it means removing the variant.h include from tensor.h, since
variant_encode_decode.h now relies on tensor.h and variant.h now relies on that.
It also means we found a bunch of places where tensor.proto.h, variant.h, and
mutex.h were being imported through tensor.h (along with a bunch of other crap);
so now we directly import them in order to compile.
2. Move Variant registry to use TypeIndex instead of a TypeName string; this should
speed up registry lookups.
PiperOrigin-RevId: 212478896
Diffstat (limited to 'tensorflow/core/platform')
-rw-r--r-- | tensorflow/core/platform/abi.cc | 4 | ||||
-rw-r--r-- | tensorflow/core/platform/abi.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/core/platform/abi.cc b/tensorflow/core/platform/abi.cc index e597a490d6..d7a13a3528 100644 --- a/tensorflow/core/platform/abi.cc +++ b/tensorflow/core/platform/abi.cc @@ -37,13 +37,13 @@ extern "C" char* __unDName(char* output_string, const char* name, namespace tensorflow { namespace port { -std::string MaybeAbiDemangle(const char* name) { +string MaybeAbiDemangle(const char* name) { #if defined(_MSC_VER) std::unique_ptr<char> demangled{__unDName(nullptr, name, 0, std::malloc, std::free, static_cast<unsigned short>(0))}; - return std::string(demangled.get() != nullptr ? demangled.get() : name); + return string(demangled.get() != nullptr ? demangled.get() : name); #else int status = 0; std::unique_ptr<char, void (*)(void*)> res{ diff --git a/tensorflow/core/platform/abi.h b/tensorflow/core/platform/abi.h index 591e83b0c4..d1498a6a64 100644 --- a/tensorflow/core/platform/abi.h +++ b/tensorflow/core/platform/abi.h @@ -17,11 +17,12 @@ limitations under the License. #define TENSORFLOW_CORE_PLATFORM_ABI_H_ #include <string> +#include "tensorflow/core/platform/types.h" namespace tensorflow { namespace port { -std::string MaybeAbiDemangle(const char* name); +string MaybeAbiDemangle(const char* name); } // namespace port } // namespace tensorflow |