diff options
author | A. Unique TensorFlower <nobody@tensorflow.org> | 2016-05-18 08:04:37 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-05-18 09:11:05 -0700 |
commit | 60adf6fe001ebef450120ce0b81412b666c02649 (patch) | |
tree | 4b61e41627ace3aaa567985fa383e9e34dd496fa /tensorflow/core/util/example_proto_helper.h | |
parent | 91615e7667b6e3c21c8c61f5accaf4cba89b3b06 (diff) |
Add ExtractExampleParserConfiguration method
- Extract the fixed length and variable length feature configurations
output tensor names from a given GraphDef.
- This will allow for the use case of bypassing an unnecessary tensorflow.Example
serialize/deserialize at serving/inference time by extracting the configuration,
running the proto -> tensor helpers directly and feeding the graph with
the properly named tensors
Change: 122636456
Diffstat (limited to 'tensorflow/core/util/example_proto_helper.h')
-rw-r--r-- | tensorflow/core/util/example_proto_helper.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tensorflow/core/util/example_proto_helper.h b/tensorflow/core/util/example_proto_helper.h index d13740c76e..8e8af8182d 100644 --- a/tensorflow/core/util/example_proto_helper.h +++ b/tensorflow/core/util/example_proto_helper.h @@ -13,14 +13,15 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef THIRD_PARTY_TENSORFLOW_CORE_UTIL_SPARSE_EXAMPLE_PROTO_HELPER_H_ -#define THIRD_PARTY_TENSORFLOW_CORE_UTIL_SPARSE_EXAMPLE_PROTO_HELPER_H_ +#ifndef THIRD_PARTY_TENSORFLOW_CORE_UTIL_EXAMPLE_PROTO_HELPER_H_ +#define THIRD_PARTY_TENSORFLOW_CORE_UTIL_EXAMPLE_PROTO_HELPER_H_ #include <string> #include <vector> #include "tensorflow/core/example/example.pb.h" #include "tensorflow/core/framework/allocator.h" +#include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/types.h" @@ -37,12 +38,16 @@ struct FixedLenFeature { DataType dtype; TensorShape shape; Tensor default_value; + string values_output_tensor_name; }; // "Sparse" feature configuration. struct VarLenFeature { string key; DataType dtype; + string values_output_tensor_name; + string indices_output_tensor_name; + string shapes_output_tensor_name; }; // Given a single tensorflow::Example, with an optional example name @@ -142,4 +147,4 @@ int64 CopyIntoSparseTensor(const Tensor& in, const int batch, } // namespace tensorflow -#endif // THIRD_PARTY_TENSORFLOW_CORE_UTIL_SPARSE_EXAMPLE_PROTO_HELPER_H_ +#endif // THIRD_PARTY_TENSORFLOW_CORE_UTIL_EXAMPLE_PROTO_HELPER_H_ |