diff options
author | 2018-05-23 12:18:23 -0700 | |
---|---|---|
committer | 2018-05-23 12:21:07 -0700 | |
commit | d2309fe5895ba431a4bb11e79564d12028cc93d5 (patch) | |
tree | 7db5c2464c4b2514157dbc3f79a7e945c3709704 /tensorflow/core/framework/variant_encode_decode.h | |
parent | f6e5089c41fc234ca19fabe2e529ee877a09a33d (diff) |
Introduce Encoder and Decoder classes so that platform/*coding* doesn't have to
depend on framework/resource_handler and framework/variant.
PiperOrigin-RevId: 197768387
Diffstat (limited to 'tensorflow/core/framework/variant_encode_decode.h')
-rw-r--r-- | tensorflow/core/framework/variant_encode_decode.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/core/framework/variant_encode_decode.h b/tensorflow/core/framework/variant_encode_decode.h index 5a84f9d943..ded04b2a30 100644 --- a/tensorflow/core/framework/variant_encode_decode.h +++ b/tensorflow/core/framework/variant_encode_decode.h @@ -259,6 +259,16 @@ void EncodeVariant(const VariantTensorDataProto& value, string* buf); template <> bool DecodeVariant(const string& buf, VariantTensorDataProto* value); +// Encodes an array of Variant objects in to the given StringListEncoder. +// `variant_array` is assumed to point to an array of `n` Variant objects. +void EncodeVariantList(const Variant* variant_array, int64 n, + std::unique_ptr<port::StringListEncoder> e); + +// Decodes an array of Variant objects from the given StringListDecoder. +// `variant_array` is assumed to point to an array of `n` Variant objects. +bool DecodeVariantList(std::unique_ptr<port::StringListDecoder> d, + Variant* variant_array, int64 n); + } // end namespace tensorflow #endif // TENSORFLOW_FRAMEWORK_VARIANT_ENCODE_DECODE_H_ |