1+ /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2+ Licensed under the Apache License, Version 2.0 (the "License");
3+ you may not use this file except in compliance with the License.
4+ You may obtain a copy of the License at
5+ http://www.apache.org/licenses/LICENSE-2.0
6+ Unless required by applicable law or agreed to in writing, software
7+ distributed under the License is distributed on an "AS IS" BASIS,
8+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+ See the License for the specific language governing permissions and
10+ limitations under the License.
11+ ==============================================================================*/
112// automatically generated by the FlatBuffers compiler, do not modify
213
314
@@ -15,12 +26,15 @@ static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
1526
1627struct TensorData ;
1728struct TensorDataBuilder ;
29+ struct TensorDataT ;
1830
1931struct SubgraphData ;
2032struct SubgraphDataBuilder ;
33+ struct SubgraphDataT ;
2134
2235struct ModelTestData ;
2336struct ModelTestDataBuilder ;
37+ struct ModelTestDataT ;
2438
2539enum TensorTypes : int8_t {
2640 TensorTypes_FLOAT32 = 0 ,
@@ -106,7 +120,19 @@ inline const char *EnumNameTensorTypes(TensorTypes e) {
106120 return EnumNamesTensorTypes ()[index];
107121}
108122
123+ struct TensorDataT : public ::flatbuffers::NativeTable {
124+ typedef TensorData TableType;
125+ uint32_t input_index = 0 ;
126+ uint32_t tensor_index = 0 ;
127+ std::vector<int32_t > shape{};
128+ TensorTypes dtype = TensorTypes_FLOAT32;
129+ std::vector<uint8_t > data{};
130+ uint32_t num_bytes = 0 ;
131+ uint32_t layer_number = 0 ;
132+ };
133+
109134struct TensorData FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
135+ typedef TensorDataT NativeTableType;
110136 typedef TensorDataBuilder Builder;
111137 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
112138 VT_INPUT_INDEX = 4 ,
@@ -151,6 +177,9 @@ struct TensorData FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
151177 VerifyField<uint32_t >(verifier, VT_LAYER_NUMBER, 4 ) &&
152178 verifier.EndTable ();
153179 }
180+ TensorDataT *UnPack (const ::flatbuffers::resolver_function_t *_resolver = nullptr ) const ;
181+ void UnPackTo (TensorDataT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr ) const ;
182+ static ::flatbuffers::Offset<TensorData> Pack (::flatbuffers::FlatBufferBuilder &_fbb, const TensorDataT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr );
154183};
155184
156185struct TensorDataBuilder {
@@ -231,7 +260,20 @@ inline ::flatbuffers::Offset<TensorData> CreateTensorDataDirect(
231260 layer_number);
232261}
233262
263+ ::flatbuffers::Offset<TensorData> CreateTensorData (::flatbuffers::FlatBufferBuilder &_fbb, const TensorDataT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr );
264+
265+ struct SubgraphDataT : public ::flatbuffers::NativeTable {
266+ typedef SubgraphData TableType;
267+ std::vector<std::unique_ptr<TensorDataT>> outputs{};
268+ uint32_t subgraph_index = 0 ;
269+ SubgraphDataT () = default ;
270+ SubgraphDataT (const SubgraphDataT &o);
271+ SubgraphDataT (SubgraphDataT&&) FLATBUFFERS_NOEXCEPT = default ;
272+ SubgraphDataT &operator =(SubgraphDataT o) FLATBUFFERS_NOEXCEPT;
273+ };
274+
234275struct SubgraphData FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
276+ typedef SubgraphDataT NativeTableType;
235277 typedef SubgraphDataBuilder Builder;
236278 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
237279 VT_OUTPUTS = 4 ,
@@ -251,6 +293,9 @@ struct SubgraphData FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
251293 VerifyField<uint32_t >(verifier, VT_SUBGRAPH_INDEX, 4 ) &&
252294 verifier.EndTable ();
253295 }
296+ SubgraphDataT *UnPack (const ::flatbuffers::resolver_function_t *_resolver = nullptr ) const ;
297+ void UnPackTo (SubgraphDataT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr ) const ;
298+ static ::flatbuffers::Offset<SubgraphData> Pack (::flatbuffers::FlatBufferBuilder &_fbb, const SubgraphDataT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr );
254299};
255300
256301struct SubgraphDataBuilder {
@@ -295,7 +340,20 @@ inline ::flatbuffers::Offset<SubgraphData> CreateSubgraphDataDirect(
295340 subgraph_index);
296341}
297342
343+ ::flatbuffers::Offset<SubgraphData> CreateSubgraphData (::flatbuffers::FlatBufferBuilder &_fbb, const SubgraphDataT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr );
344+
345+ struct ModelTestDataT : public ::flatbuffers::NativeTable {
346+ typedef ModelTestData TableType;
347+ std::vector<std::unique_ptr<TensorDataT>> input_data{};
348+ std::vector<std::unique_ptr<SubgraphDataT>> subgraph_data{};
349+ ModelTestDataT () = default ;
350+ ModelTestDataT (const ModelTestDataT &o);
351+ ModelTestDataT (ModelTestDataT&&) FLATBUFFERS_NOEXCEPT = default ;
352+ ModelTestDataT &operator =(ModelTestDataT o) FLATBUFFERS_NOEXCEPT;
353+ };
354+
298355struct ModelTestData FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
356+ typedef ModelTestDataT NativeTableType;
299357 typedef ModelTestDataBuilder Builder;
300358 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
301359 VT_INPUT_DATA = 4 ,
@@ -317,6 +375,9 @@ struct ModelTestData FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
317375 verifier.VerifyVectorOfTables (subgraph_data ()) &&
318376 verifier.EndTable ();
319377 }
378+ ModelTestDataT *UnPack (const ::flatbuffers::resolver_function_t *_resolver = nullptr ) const ;
379+ void UnPackTo (ModelTestDataT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr ) const ;
380+ static ::flatbuffers::Offset<ModelTestData> Pack (::flatbuffers::FlatBufferBuilder &_fbb, const ModelTestDataT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr );
320381};
321382
322383struct ModelTestDataBuilder {
@@ -362,6 +423,135 @@ inline ::flatbuffers::Offset<ModelTestData> CreateModelTestDataDirect(
362423 subgraph_data__);
363424}
364425
426+ ::flatbuffers::Offset<ModelTestData> CreateModelTestData (::flatbuffers::FlatBufferBuilder &_fbb, const ModelTestDataT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr );
427+
428+ inline TensorDataT *TensorData::UnPack (const ::flatbuffers::resolver_function_t *_resolver) const {
429+ auto _o = std::unique_ptr<TensorDataT>(new TensorDataT ());
430+ UnPackTo (_o.get (), _resolver);
431+ return _o.release ();
432+ }
433+
434+ inline void TensorData::UnPackTo (TensorDataT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
435+ (void )_o;
436+ (void )_resolver;
437+ { auto _e = input_index (); _o->input_index = _e; }
438+ { auto _e = tensor_index (); _o->tensor_index = _e; }
439+ { auto _e = shape (); if (_e) { _o->shape .resize (_e->size ()); for (::flatbuffers::uoffset_t _i = 0 ; _i < _e->size (); _i++) { _o->shape [_i] = _e->Get (_i); } } else { _o->shape .resize (0 ); } }
440+ { auto _e = dtype (); _o->dtype = _e; }
441+ { auto _e = data (); if (_e) { _o->data .resize (_e->size ()); std::copy (_e->begin (), _e->end (), _o->data .begin ()); } }
442+ { auto _e = num_bytes (); _o->num_bytes = _e; }
443+ { auto _e = layer_number (); _o->layer_number = _e; }
444+ }
445+
446+ inline ::flatbuffers::Offset<TensorData> TensorData::Pack (::flatbuffers::FlatBufferBuilder &_fbb, const TensorDataT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
447+ return CreateTensorData (_fbb, _o, _rehasher);
448+ }
449+
450+ inline ::flatbuffers::Offset<TensorData> CreateTensorData (::flatbuffers::FlatBufferBuilder &_fbb, const TensorDataT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
451+ (void )_rehasher;
452+ (void )_o;
453+ struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const TensorDataT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void )_va;
454+ auto _input_index = _o->input_index ;
455+ auto _tensor_index = _o->tensor_index ;
456+ auto _shape = _o->shape .size () ? _fbb.CreateVector (_o->shape ) : 0 ;
457+ auto _dtype = _o->dtype ;
458+ auto _data = _o->data .size () ? _fbb.CreateVector (_o->data ) : 0 ;
459+ auto _num_bytes = _o->num_bytes ;
460+ auto _layer_number = _o->layer_number ;
461+ return CreateTensorData (
462+ _fbb,
463+ _input_index,
464+ _tensor_index,
465+ _shape,
466+ _dtype,
467+ _data,
468+ _num_bytes,
469+ _layer_number);
470+ }
471+
472+ inline SubgraphDataT::SubgraphDataT (const SubgraphDataT &o)
473+ : subgraph_index(o.subgraph_index) {
474+ outputs.reserve (o.outputs .size ());
475+ for (const auto &outputs_ : o.outputs ) { outputs.emplace_back ((outputs_) ? new TensorDataT (*outputs_) : nullptr ); }
476+ }
477+
478+ inline SubgraphDataT &SubgraphDataT::operator =(SubgraphDataT o) FLATBUFFERS_NOEXCEPT {
479+ std::swap (outputs, o.outputs );
480+ std::swap (subgraph_index, o.subgraph_index );
481+ return *this ;
482+ }
483+
484+ inline SubgraphDataT *SubgraphData::UnPack (const ::flatbuffers::resolver_function_t *_resolver) const {
485+ auto _o = std::unique_ptr<SubgraphDataT>(new SubgraphDataT ());
486+ UnPackTo (_o.get (), _resolver);
487+ return _o.release ();
488+ }
489+
490+ inline void SubgraphData::UnPackTo (SubgraphDataT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
491+ (void )_o;
492+ (void )_resolver;
493+ { auto _e = outputs (); if (_e) { _o->outputs .resize (_e->size ()); for (::flatbuffers::uoffset_t _i = 0 ; _i < _e->size (); _i++) { if (_o->outputs [_i]) { _e->Get (_i)->UnPackTo (_o->outputs [_i].get (), _resolver); } else { _o->outputs [_i] = std::unique_ptr<TensorDataT>(_e->Get (_i)->UnPack (_resolver)); }; } } else { _o->outputs .resize (0 ); } }
494+ { auto _e = subgraph_index (); _o->subgraph_index = _e; }
495+ }
496+
497+ inline ::flatbuffers::Offset<SubgraphData> SubgraphData::Pack (::flatbuffers::FlatBufferBuilder &_fbb, const SubgraphDataT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
498+ return CreateSubgraphData (_fbb, _o, _rehasher);
499+ }
500+
501+ inline ::flatbuffers::Offset<SubgraphData> CreateSubgraphData (::flatbuffers::FlatBufferBuilder &_fbb, const SubgraphDataT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
502+ (void )_rehasher;
503+ (void )_o;
504+ struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const SubgraphDataT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void )_va;
505+ auto _outputs = _o->outputs .size () ? _fbb.CreateVector <::flatbuffers::Offset<TensorData>> (_o->outputs .size (), [](size_t i, _VectorArgs *__va) { return CreateTensorData (*__va->__fbb , __va->__o ->outputs [i].get (), __va->__rehasher ); }, &_va ) : 0 ;
506+ auto _subgraph_index = _o->subgraph_index ;
507+ return CreateSubgraphData (
508+ _fbb,
509+ _outputs,
510+ _subgraph_index);
511+ }
512+
513+ inline ModelTestDataT::ModelTestDataT (const ModelTestDataT &o) {
514+ input_data.reserve (o.input_data .size ());
515+ for (const auto &input_data_ : o.input_data ) { input_data.emplace_back ((input_data_) ? new TensorDataT (*input_data_) : nullptr ); }
516+ subgraph_data.reserve (o.subgraph_data .size ());
517+ for (const auto &subgraph_data_ : o.subgraph_data ) { subgraph_data.emplace_back ((subgraph_data_) ? new SubgraphDataT (*subgraph_data_) : nullptr ); }
518+ }
519+
520+ inline ModelTestDataT &ModelTestDataT::operator =(ModelTestDataT o) FLATBUFFERS_NOEXCEPT {
521+ std::swap (input_data, o.input_data );
522+ std::swap (subgraph_data, o.subgraph_data );
523+ return *this ;
524+ }
525+
526+ inline ModelTestDataT *ModelTestData::UnPack (const ::flatbuffers::resolver_function_t *_resolver) const {
527+ auto _o = std::unique_ptr<ModelTestDataT>(new ModelTestDataT ());
528+ UnPackTo (_o.get (), _resolver);
529+ return _o.release ();
530+ }
531+
532+ inline void ModelTestData::UnPackTo (ModelTestDataT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
533+ (void )_o;
534+ (void )_resolver;
535+ { auto _e = input_data (); if (_e) { _o->input_data .resize (_e->size ()); for (::flatbuffers::uoffset_t _i = 0 ; _i < _e->size (); _i++) { if (_o->input_data [_i]) { _e->Get (_i)->UnPackTo (_o->input_data [_i].get (), _resolver); } else { _o->input_data [_i] = std::unique_ptr<TensorDataT>(_e->Get (_i)->UnPack (_resolver)); }; } } else { _o->input_data .resize (0 ); } }
536+ { auto _e = subgraph_data (); if (_e) { _o->subgraph_data .resize (_e->size ()); for (::flatbuffers::uoffset_t _i = 0 ; _i < _e->size (); _i++) { if (_o->subgraph_data [_i]) { _e->Get (_i)->UnPackTo (_o->subgraph_data [_i].get (), _resolver); } else { _o->subgraph_data [_i] = std::unique_ptr<SubgraphDataT>(_e->Get (_i)->UnPack (_resolver)); }; } } else { _o->subgraph_data .resize (0 ); } }
537+ }
538+
539+ inline ::flatbuffers::Offset<ModelTestData> ModelTestData::Pack (::flatbuffers::FlatBufferBuilder &_fbb, const ModelTestDataT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
540+ return CreateModelTestData (_fbb, _o, _rehasher);
541+ }
542+
543+ inline ::flatbuffers::Offset<ModelTestData> CreateModelTestData (::flatbuffers::FlatBufferBuilder &_fbb, const ModelTestDataT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
544+ (void )_rehasher;
545+ (void )_o;
546+ struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const ModelTestDataT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void )_va;
547+ auto _input_data = _o->input_data .size () ? _fbb.CreateVector <::flatbuffers::Offset<TensorData>> (_o->input_data .size (), [](size_t i, _VectorArgs *__va) { return CreateTensorData (*__va->__fbb , __va->__o ->input_data [i].get (), __va->__rehasher ); }, &_va ) : 0 ;
548+ auto _subgraph_data = _o->subgraph_data .size () ? _fbb.CreateVector <::flatbuffers::Offset<SubgraphData>> (_o->subgraph_data .size (), [](size_t i, _VectorArgs *__va) { return CreateSubgraphData (*__va->__fbb , __va->__o ->subgraph_data [i].get (), __va->__rehasher ); }, &_va ) : 0 ;
549+ return CreateModelTestData (
550+ _fbb,
551+ _input_data,
552+ _subgraph_data);
553+ }
554+
365555inline const ModelTestData *GetModelTestData (const void *buf) {
366556 return ::flatbuffers::GetRoot<ModelTestData>(buf);
367557}
@@ -392,4 +582,16 @@ inline void FinishSizePrefixedModelTestDataBuffer(
392582 fbb.FinishSizePrefixed (root);
393583}
394584
585+ inline std::unique_ptr<ModelTestDataT> UnPackModelTestData (
586+ const void *buf,
587+ const ::flatbuffers::resolver_function_t *res = nullptr ) {
588+ return std::unique_ptr<ModelTestDataT>(GetModelTestData (buf)->UnPack (res));
589+ }
590+
591+ inline std::unique_ptr<ModelTestDataT> UnPackSizePrefixedModelTestData (
592+ const void *buf,
593+ const ::flatbuffers::resolver_function_t *res = nullptr ) {
594+ return std::unique_ptr<ModelTestDataT>(GetSizePrefixedModelTestData (buf)->UnPack (res));
595+ }
596+
395597#endif // FLATBUFFERS_GENERATED_LAYERBYLAYERSCHEMA_H_
0 commit comments