Home
last modified time | relevance | path

Searched refs:fbb (Results 1 – 25 of 58) sorted by relevance

123

/external/flatbuffers/tests/FlatBuffers.Test/
DFlatBufferBuilderTests.cs26 var fbb = new FlatBufferBuilder(16) {ForceDefaults = forceDefaults}; in CreateBuffer()
27 fbb.StartObject(1); in CreateBuffer()
28 return fbb; in CreateBuffer()
34 var fbb = CreateBuffer(); in FlatBufferBuilder_WithForceDefaults_WhenAddBool_AndDefaultValue_OffsetIncreasesBySize()
35 var storedOffset = fbb.Offset; in FlatBufferBuilder_WithForceDefaults_WhenAddBool_AndDefaultValue_OffsetIncreasesBySize()
36 fbb.AddBool(0, false, false); in FlatBufferBuilder_WithForceDefaults_WhenAddBool_AndDefaultValue_OffsetIncreasesBySize()
37 var endOffset = fbb.Offset; in FlatBufferBuilder_WithForceDefaults_WhenAddBool_AndDefaultValue_OffsetIncreasesBySize()
44 var fbb = CreateBuffer(); in FlatBufferBuilder_WithForceDefaults_WhenAddSByte_AndDefaultValue_OffsetIncreasesBySize()
45 var storedOffset = fbb.Offset; in FlatBufferBuilder_WithForceDefaults_WhenAddSByte_AndDefaultValue_OffsetIncreasesBySize()
46 fbb.AddSbyte(0, 0, 0); in FlatBufferBuilder_WithForceDefaults_WhenAddSByte_AndDefaultValue_OffsetIncreasesBySize()
[all …]
DFlatBuffersExampleTests.cs46 var fbb = new FlatBufferBuilder(1); in CanCreateNewFlatBufferFromScratch()
48 …StringOffset[] names = { fbb.CreateString("Frodo"), fbb.CreateString("Barney"), fbb.CreateString("… in CanCreateNewFlatBufferFromScratch()
50 Monster.StartMonster(fbb); in CanCreateNewFlatBufferFromScratch()
51 Monster.AddName(fbb, names[0]); in CanCreateNewFlatBufferFromScratch()
52 off[0] = Monster.EndMonster(fbb); in CanCreateNewFlatBufferFromScratch()
53 Monster.StartMonster(fbb); in CanCreateNewFlatBufferFromScratch()
54 Monster.AddName(fbb, names[1]); in CanCreateNewFlatBufferFromScratch()
55 off[1] = Monster.EndMonster(fbb); in CanCreateNewFlatBufferFromScratch()
56 Monster.StartMonster(fbb); in CanCreateNewFlatBufferFromScratch()
57 Monster.AddName(fbb, names[2]); in CanCreateNewFlatBufferFromScratch()
[all …]
/external/flatbuffers/tests/
DJavaTest.java57 FlatBufferBuilder fbb = new FlatBufferBuilder(1); in main() local
59 TestBuilderBasics(fbb, true); in main()
60 TestBuilderBasics(fbb, false); in main()
62 TestExtendedBuffer(fbb.dataBuffer().asReadOnlyBuffer()); in main()
151 FlatBufferBuilder fbb = new FlatBufferBuilder(1); in TestNamespaceNesting() local
153 TableInNestedNS.startTableInNestedNS(fbb); in TestNamespaceNesting()
154 TableInNestedNS.addFoo(fbb, 1234); in TestNamespaceNesting()
155 int nestedTableOff = TableInNestedNS.endTableInNestedNS(fbb); in TestNamespaceNesting()
157 TableInFirstNS.startTableInFirstNS(fbb); in TestNamespaceNesting()
158 TableInFirstNS.addFooTable(fbb, nestedTableOff); in TestNamespaceNesting()
[all …]
DJavaScriptTest.js23 var fbb = new flatbuffers.Builder(1);
24 createMonster(fbb);
25 serializeAndTest(fbb);
29 var startingCapacity = fbb.bb.capacity();
31 fbb.clear();
32 createMonster(fbb);
33 serializeAndTest(fbb);
36 assert.strictEqual(fbb.bb.capacity(), startingCapacity);
45 function createMonster(fbb) { argument
48 var str = fbb.createString('MyMonster');
[all …]
DJavaScriptUnionVectorTest.js7 var fbb = new flatbuffers.Builder();
15 Test.Attacker.startAttacker(fbb);
16 Test.Attacker.addSwordAttackDamage(fbb, 5);
17 var attackerOffset = Test.Attacker.endAttacker(fbb);
19 var charTypesOffset = Test.Movie.createCharactersTypeVector(fbb, charTypes);
21 fbb,
23 Test.BookReader.createBookReader(fbb, 7),
25 Test.BookReader.createBookReader(fbb, 2),
29 Test.Movie.startMovie(fbb);
30 Test.Movie.addCharactersType(fbb, charTypesOffset);
[all …]
DphpUnionVectorTest.php51 $fbb = new Google\FlatBuffers\FlatBufferBuilder(1);
59 Attacker::startAttacker($fbb);
60 Attacker::addSwordAttackDamage($fbb, 5);
61 $attackerOffset = Attacker::endAttacker($fbb);
63 $charTypesOffset = Movie::createCharactersTypeVector($fbb, $charTypes);
65 $fbb,
67 BookReader::createBookReader($fbb, 7),
69 BookReader::createBookReader($fbb, 2),
73 Movie::startMovie($fbb);
74 Movie::addCharactersType($fbb, $charTypesOffset);
[all …]
DphpTest.php29 $fbb = new Google\FlatBuffers\FlatBufferBuilder(1);
32 $str = $fbb->createString("MyMonster");
33 $name = $fbb->createString('Fred');
34 \MyGame\Example\Monster::startMonster($fbb);
35 \MyGame\Example\Monster::addName($fbb, $name);
36 $enemy = \MyGame\Example\Monster::endMonster($fbb);
38 $inv = \MyGame\Example\Monster::CreateInventoryVector($fbb, array(0, 1, 2, 3, 4));
40 $fred = $fbb->createString('Fred');
41 \MyGame\Example\Monster::StartMonster($fbb);
42 \MyGame\Example\Monster::AddName($fbb, $fred);
[all …]
Dtest_builder.h37 uint8_t *release_raw_base(flatbuffers::FlatBufferBuilder &fbb, size_t &size, size_t &offset);
40 void free_raw(flatbuffers::FlatBufferBuilder &fbb, uint8_t *buf);
45 bool release_n_verify(flatbuffers::FlatBufferBuilder &fbb, const std::string &expected_name, Color …
243 DestBuilder fbb;
246 auto root_offset1 = populate1(fbb);
247 fbb.Finish(root_offset1);
248 buffers.push_back(fbb.Release());
258 DestBuilder fbb;
260 auto root_offset1 = populate1(fbb);
261 fbb.Finish(root_offset1);
[all …]
Dtest_builder.cpp98 uint8_t *release_raw_base(flatbuffers::FlatBufferBuilder &fbb, size_t &size, size_t &offset) { in release_raw_base() argument
99 return fbb.ReleaseRaw(size, offset); in release_raw_base()
126 bool release_n_verify(flatbuffers::FlatBufferBuilder &fbb, const std::string &expected_name, Color … in release_n_verify() argument
127 flatbuffers::DetachedBuffer buf = fbb.Release(); in release_n_verify()
Dtest.cpp534 flatbuffers::FlatBufferBuilder fbb; in SizePrefixedTest() local
536 fbb, in SizePrefixedTest()
537 CreateMonster(fbb, 0, 200, 300, fbb.CreateString("bob"))); in SizePrefixedTest()
540 flatbuffers::Verifier verifier(fbb.GetBufferPointer(), fbb.GetSize()); in SizePrefixedTest()
544 auto m = GetSizePrefixedMonster(fbb.GetBufferPointer()); in SizePrefixedTest()
854 flatbuffers::FlatBufferBuilder fbb; in ReflectionTest() local
856 fbb, schema, *root_table, *flatbuffers::GetAnyRoot(flatbuf), true); in ReflectionTest()
857 fbb.Finish(root_offset, MonsterIdentifier()); in ReflectionTest()
859 AccessFlatBufferTest(fbb.GetBufferPointer(), fbb.GetSize()); in ReflectionTest()
863 fbb.GetBufferPointer(), fbb.GetSize()), in ReflectionTest()
[all …]
/external/tensorflow/tensorflow/lite/experimental/microfrontend/
Daudio_microfrontend_test.cc53 flexbuffers::Builder fbb; in MicroFrontendOpModel() local
54 fbb.Map([&]() { in MicroFrontendOpModel()
56 fbb.Int("sample_rate", 1000); in MicroFrontendOpModel()
57 fbb.Int("window_size", 25); in MicroFrontendOpModel()
58 fbb.Int("window_step", 10); in MicroFrontendOpModel()
59 fbb.Int("num_channels", 2); in MicroFrontendOpModel()
60 fbb.Float("upper_band_limit", 450.0); in MicroFrontendOpModel()
61 fbb.Float("lower_band_limit", 8.0); in MicroFrontendOpModel()
62 fbb.Int("smoothing_bits", 10); in MicroFrontendOpModel()
63 fbb.Float("even_smoothing", 0.025); in MicroFrontendOpModel()
[all …]
/external/flatbuffers/grpc/tests/
Dmessage_builder_test.cpp225 flatbuffers::FlatBufferBuilder fbb(initial_size); in builder_move_ctor_conversion_before_finish_half_n_half_table_test() local
226 auto name_offset = fbb.CreateString(m1_name); in builder_move_ctor_conversion_before_finish_half_n_half_table_test()
227 MyGame::Example::MonsterBuilder monsterBuilder(fbb); // starts a table in FlatBufferBuilder in builder_move_ctor_conversion_before_finish_half_n_half_table_test()
229 flatbuffers::grpc::MessageBuilder mb(std::move(fbb)); in builder_move_ctor_conversion_before_finish_half_n_half_table_test()
234 TEST_EQ_FUNC(fbb.GetSize(), 0); in builder_move_ctor_conversion_before_finish_half_n_half_table_test()
241 flatbuffers::FlatBufferBuilder fbb(initial_size); in builder_move_ctor_conversion_before_finish_test() local
242 auto stat_offset = CreateStat(fbb, fbb.CreateString("SomeId"), 0, 0); in builder_move_ctor_conversion_before_finish_test()
243 flatbuffers::grpc::MessageBuilder mb(std::move(fbb)); in builder_move_ctor_conversion_before_finish_test()
247 TEST_EQ_FUNC(fbb.GetSize(), 0); in builder_move_ctor_conversion_before_finish_test()
255 flatbuffers::FlatBufferBuilder fbb; in builder_move_assign_conversion_before_finish_half_n_half_table_test() local
[all …]
Dgrpctest.cpp102 Builder fbb; in StoreRPC() local
105 auto monster_offset = CreateMonster(fbb, 0, 0, 0, fbb.CreateString("Fred")); in StoreRPC()
106 MessageBuilder mb(std::move(fbb)); in StoreRPC()
124 Builder fbb; in RetrieveRPC() local
126 fbb.Clear(); in RetrieveRPC()
127 auto stat_offset = CreateStat(fbb, fbb.CreateString("Fred")); in RetrieveRPC()
128 fbb.Finish(stat_offset); in RetrieveRPC()
129 auto request = MessageBuilder(std::move(fbb)).ReleaseMessage<Stat>(); in RetrieveRPC()
/external/tensorflow/tensorflow/lite/experimental/writer/
Dwriter_lib.cc34 FlatBufferBuilder* fbb, enum BuiltinOperator op, void* builtin_op_data) { in CreateBuiltinUnion() argument
42 Offset<Vector<T_OUTPUT>> InterpreterWriter::ExportVector(FlatBufferBuilder* fbb, in ExportVector() argument
45 return fbb->template CreateVector<T_OUTPUT>(inputs); in ExportVector()
49 FlatBufferBuilder* fbb) { in ExportOperators() argument
84 fbb, static_cast<enum BuiltinOperator>(registration.builtin_code), in ExportOperators()
93 custom_writer->second(fbb, interpreter_, op_index, &custom_options, in ExportOperators()
97 custom_options = fbb->CreateVector( in ExportOperators()
108 auto inputs = ExportVector<int32_t>(fbb, written_inputs); in ExportOperators()
109 auto outputs = ExportVector<int32_t>(fbb, written_outputs); in ExportOperators()
110 operators.push_back(CreateOperator(*fbb, opcode_index, inputs, outputs, in ExportOperators()
[all …]
Dwriter_lib.h45 flatbuffers::FlatBufferBuilder* fbb, Interpreter* interpreter,
75 flatbuffers::FlatBufferBuilder* fbb, const T_INPUT& v);
77 flatbuffers::FlatBufferBuilder* fbb);
79 flatbuffers::FlatBufferBuilder* fbb);
81 flatbuffers::FlatBufferBuilder* fbb);
83 flatbuffers::FlatBufferBuilder* fbb);
/external/tensorflow/tensorflow/lite/kernels/
Ddetection_postprocess_test.cc55 flexbuffers::Builder fbb; in BaseDetectionPostprocessOpModel() local
56 fbb.Map([&]() { in BaseDetectionPostprocessOpModel()
57 fbb.Int("max_detections", 3); in BaseDetectionPostprocessOpModel()
58 fbb.Int("max_classes_per_detection", 1); in BaseDetectionPostprocessOpModel()
59 fbb.Float("nms_score_threshold", 0.0); in BaseDetectionPostprocessOpModel()
60 fbb.Float("nms_iou_threshold", 0.5); in BaseDetectionPostprocessOpModel()
61 fbb.Int("num_classes", 2); in BaseDetectionPostprocessOpModel()
62 fbb.Float("y_scale", 10.0); in BaseDetectionPostprocessOpModel()
63 fbb.Float("x_scale", 10.0); in BaseDetectionPostprocessOpModel()
64 fbb.Float("h_scale", 5.0); in BaseDetectionPostprocessOpModel()
[all …]
Dmfcc_test.cc46 flexbuffers::Builder fbb; in BaseMfccOpModel() local
47 fbb.Map([&]() { in BaseMfccOpModel()
48 fbb.Int("upper_frequency_limit", 4000); in BaseMfccOpModel()
49 fbb.Int("lower_frequency_limit", 20); in BaseMfccOpModel()
50 fbb.Int("filterbank_channel_count", 40); in BaseMfccOpModel()
51 fbb.Int("dct_coefficient_count", 13); in BaseMfccOpModel()
53 fbb.Finish(); in BaseMfccOpModel()
54 SetCustomOp("Mfcc", fbb.GetBuffer(), Register_MFCC); in BaseMfccOpModel()
Daudio_spectrogram_test.cc46 flexbuffers::Builder fbb; in BaseAudioSpectrogramOpModel() local
47 fbb.Map([&]() { in BaseAudioSpectrogramOpModel()
48 fbb.Int("window_size", window_size); in BaseAudioSpectrogramOpModel()
49 fbb.Int("stride", stride); in BaseAudioSpectrogramOpModel()
50 fbb.Bool("magnitude_squared", magnitude_squared); in BaseAudioSpectrogramOpModel()
52 fbb.Finish(); in BaseAudioSpectrogramOpModel()
53 SetCustomOp("AudioSpectrogram", fbb.GetBuffer(), in BaseAudioSpectrogramOpModel()
Dsubgraph_test_util.cc171 flexbuffers::Builder fbb; in BuildIfSubgraph() local
172 fbb.Map([&]() { in BuildIfSubgraph()
173 fbb.Int("then_subgraph_index", 1); in BuildIfSubgraph()
174 fbb.Int("else_subgraph_index", 2); in BuildIfSubgraph()
176 fbb.Finish(); in BuildIfSubgraph()
177 const auto& buffer = fbb.GetBuffer(); in BuildIfSubgraph()
334 flexbuffers::Builder fbb; in BuildWhileSubgraph() local
335 fbb.Map([&]() { in BuildWhileSubgraph()
336 fbb.Int("cond_subgraph_index", 1); in BuildWhileSubgraph()
337 fbb.Int("body_subgraph_index", 2); in BuildWhileSubgraph()
[all …]
/external/tensorflow/tensorflow/lite/toco/tflite/
Dcustom_operator.h41 flexbuffers::Builder* fbb) const {} in WriteOptions() argument
49 flexbuffers::Builder fbb; in Serialize() local
50 fbb.Map( in Serialize()
51 [&]() { WriteOptions(static_cast<const TocoOperator&>(op), &fbb); }); in Serialize()
52 fbb.Finish(); in Serialize()
53 return Options::Custom(builder->CreateVector(fbb.GetBuffer())); in Serialize()
/external/flatbuffers/src/
Dreflection.cpp361 void CopyInline(FlatBufferBuilder &fbb, const reflection::Field &fielddef, in CopyInline() argument
363 fbb.Align(align); in CopyInline()
364 fbb.PushBytes(table.GetStruct<const uint8_t *>(fielddef.offset()), size); in CopyInline()
365 fbb.TrackField(fielddef.offset(), fbb.GetSize()); in CopyInline()
368 Offset<const Table *> CopyTable(FlatBufferBuilder &fbb, in CopyTable() argument
384 ? fbb.CreateSharedString(GetFieldS(table, fielddef)).o in CopyTable()
385 : fbb.CreateString(GetFieldS(table, fielddef)).o; in CopyTable()
392 CopyTable(fbb, schema, subobjectdef, *GetFieldT(table, fielddef)) in CopyTable()
400 CopyTable(fbb, schema, subobjectdef, *GetFieldT(table, fielddef)).o; in CopyTable()
417 ? fbb.CreateSharedString(vec_s->Get(i)).o in CopyTable()
[all …]
/external/tensorflow/tensorflow/lite/experimental/kernels/
Dctc_beam_search_decoder_test.cc55 flexbuffers::Builder fbb; in CTCBeamSearchDecoderOpModel() local
56 fbb.Map([&]() { in CTCBeamSearchDecoderOpModel()
57 fbb.Int("beam_width", beam_width); in CTCBeamSearchDecoderOpModel()
58 fbb.Int("top_paths", top_paths); in CTCBeamSearchDecoderOpModel()
59 fbb.Bool("merge_repeated", merge_repeated); in CTCBeamSearchDecoderOpModel()
61 fbb.Finish(); in CTCBeamSearchDecoderOpModel()
62 SetCustomOp("CTCBeamSearchDecoder", fbb.GetBuffer(), in CTCBeamSearchDecoderOpModel()
/external/flatbuffers/rust/flatbuffers/src/
Dbuilder.rs43 pub struct FlatBufferBuilder<'fbb> {
55 _phantom: PhantomData<&'fbb ()>,
58 impl<'fbb> FlatBufferBuilder<'fbb> {
217 pub fn end_vector<T: Push>(&mut self, num_elems: usize) -> WIPOffset<Vector<'fbb, T>> { in end_vector() argument
228 pub fn create_string<'a: 'b, 'b>(&'a mut self, s: &'b str) -> WIPOffset<&'fbb str> { in create_string()
235 pub fn create_byte_string(&mut self, data: &[u8]) -> WIPOffset<&'fbb [u8]> { in create_byte_string()
251 … SafeSliceAccess + Push + Sized + 'b>(&'a mut self, items: &'b [T]) -> WIPOffset<Vector<'fbb, T>> { in create_vector_direct() argument
271 …s<'a, 'b>(&'a mut self, xs: &'b [&'b str]) -> WIPOffset<Vector<'fbb, ForwardsUOffset<&'fbb str>>> { in create_vector_of_strings() argument
291 … 'b, 'b, T: Push + Copy + 'b>(&'a mut self, items: &'b [T]) -> WIPOffset<Vector<'fbb, T::Output>> { in create_vector() argument
/external/tensorflow/tensorflow/lite/delegates/flex/
Dtest_util.cc178 flexbuffers::Builder fbb; in AddTfOp() local
179 fbb.Vector([&]() { in AddTfOp()
180 fbb.String(nodedef.op()); in AddTfOp()
181 fbb.String(serialized_nodedef); in AddTfOp()
183 fbb.Finish(); in AddTfOp()
185 flexbuffers_.push_back(fbb.GetBuffer()); in AddTfOp()
/external/flatbuffers/docs/source/
DFlexBuffers.md42 flexbuffers::Builder fbb;
43 fbb.Int(13);
44 fbb.Finish();
52 as `fbb.GetBuffer()`. Write it, send it, or store it in a parent FlatBuffer. In
71 Here's a slightly more complex value you could write instead of `fbb.Int` above:
74 fbb.Map([&]() {
75 fbb.Vector("vec", [&]() {
76 fbb.Int(-100);
77 fbb.String("Fred");
78 fbb.IndirectFloat(4.0f);
[all …]

123