See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
+
#include "tensorflow/core/util/example_proto_fast_parsing.h"
#include "tensorflow/core/example/example.pb.h"
}
}
-string MakeSerializedExample() {
- Example example;
- const int kFeatureNameLength = 10;
- const int kFeatureValueLength = 20;
- const int kBytesFeatureCount = 200;
- const int kFloatFeatureCount = 200;
- const int kInt64FeatureCount = 200;
- auto& fmap = *example.mutable_features()->mutable_feature();
- for (int i = 0; i < kBytesFeatureCount; ++i) {
- fmap[strings::StrCat(string('b', kFeatureNameLength), i)]
- .mutable_bytes_list()
- ->add_value(string('v', kFeatureValueLength));
- }
- for (int i = 0; i < kFloatFeatureCount; ++i) {
- fmap[strings::StrCat(string('f', kFeatureNameLength), i)]
- .mutable_float_list()
- ->add_value(123123123.123);
- }
- for (int i = 0; i < kInt64FeatureCount; ++i) {
- fmap[strings::StrCat(string('i', kFeatureNameLength), i)]
- .mutable_int64_list()
- ->add_value(10 * i);
- }
- string serialized;
- example.SerializeToString(&serialized);
- return serialized;
-}
-
TEST(TestFastParseExample, Empty) {
Result result;
FastParseExampleConfig config;
}
} // namespace
-
} // namespace example
} // namespace tensorflow