Skip to content

Commit 28df067

Browse files
author
Mathieu
committed
fix: final class for tflite bindings
1 parent 83a2013 commit 28df067

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

lib/src/bindings/tensorflow_lite_bindings_generated.dart

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,12 +2057,12 @@ class TensorFlowLiteBindings {
20572057
.asFunction<void Function(ffi.Pointer<TfLiteDelegate>)>();
20582058
}
20592059

2060-
class TfLiteModel extends ffi.Opaque {}
2060+
final class TfLiteModel extends ffi.Opaque {}
20612061

2062-
class TfLiteInterpreterOptions extends ffi.Opaque {}
2062+
final class TfLiteInterpreterOptions extends ffi.Opaque {}
20632063

20642064
/// WARNING: This is an experimental interface that is subject to change.
2065-
class TfLiteDelegate extends ffi.Struct {
2065+
final class TfLiteDelegate extends ffi.Struct {
20662066
/// Data that delegate needs to identify itself. This data is owned by the
20672067
/// delegate. The delegate is owned in the user code, so the delegate is
20682068
/// responsible for deallocating this when it is destroyed.
@@ -2171,7 +2171,7 @@ abstract class TfLiteStatus {
21712171

21722172
/// Forward declare so dependent structs and methods can reference these types
21732173
/// prior to the struct definitions.
2174-
class TfLiteContext extends ffi.Struct {
2174+
final class TfLiteContext extends ffi.Struct {
21752175
/// Number of tensors in the context.
21762176
@ffi.Size()
21772177
external int tensors_size;
@@ -2418,9 +2418,9 @@ class TfLiteContext extends ffi.Struct {
24182418

24192419
/// Fixed size list of integers. Used for dimensions and inputs/outputs tensor
24202420
/// indices
2421-
class TfLiteIntArray extends ffi.Opaque {}
2421+
final class TfLiteIntArray extends ffi.Opaque {}
24222422

2423-
class TfLiteTensor extends ffi.Struct {
2423+
final class TfLiteTensor extends ffi.Struct {
24242424
/// The data type specification for data stored in `data`. This affects
24252425
/// what member of `data` union should be used.
24262426
@ffi.Int32()
@@ -2521,7 +2521,7 @@ abstract class TfLiteType {
25212521
}
25222522

25232523
/// A union of pointers that points to memory for a given tensor.
2524-
class TfLitePtrUnion extends ffi.Union {
2524+
final class TfLitePtrUnion extends ffi.Union {
25252525
/// Do not access these members directly, if possible, use
25262526
/// GetTensorData<TYPE>(tensor) instead, otherwise only access .data, as other
25272527
/// members are deprecated.
@@ -2562,13 +2562,13 @@ class TfLitePtrUnion extends ffi.Union {
25622562
}
25632563

25642564
/// Half precision data type compatible with the C99 definition.
2565-
class TfLiteFloat16 extends ffi.Struct {
2565+
final class TfLiteFloat16 extends ffi.Struct {
25662566
@ffi.Uint16()
25672567
external int data;
25682568
}
25692569

25702570
/// Single-precision complex data type compatible with the C99 definition.
2571-
class TfLiteComplex64 extends ffi.Struct {
2571+
final class TfLiteComplex64 extends ffi.Struct {
25722572
/// real and imaginary parts, respectively.
25732573
@ffi.Float()
25742574
external double re;
@@ -2578,7 +2578,7 @@ class TfLiteComplex64 extends ffi.Struct {
25782578
}
25792579

25802580
/// Double-precision complex data type compatible with the C99 definition.
2581-
class TfLiteComplex128 extends ffi.Struct {
2581+
final class TfLiteComplex128 extends ffi.Struct {
25822582
/// real and imaginary parts, respectively.
25832583
@ffi.Double()
25842584
external double re;
@@ -2593,7 +2593,7 @@ class TfLiteComplex128 extends ffi.Struct {
25932593
/// Parameters for asymmetric quantization. Quantized values can be converted
25942594
/// back to float using:
25952595
/// real_value = scale * (quantized_value - zero_point)
2596-
class TfLiteQuantizationParams extends ffi.Struct {
2596+
final class TfLiteQuantizationParams extends ffi.Struct {
25972597
@ffi.Float()
25982598
external double scale;
25992599

@@ -2628,7 +2628,7 @@ abstract class TfLiteAllocationType {
26282628
typedef TfLiteBufferHandle = ffi.Int;
26292629

26302630
/// Structure specifying the quantization used by the tensor, if-any.
2631-
class TfLiteQuantization extends ffi.Struct {
2631+
final class TfLiteQuantization extends ffi.Struct {
26322632
/// The type of quantization held by params.
26332633
@ffi.Int32()
26342634
external int type;
@@ -2651,7 +2651,7 @@ abstract class TfLiteQuantizationType {
26512651

26522652
/// Parameters used to encode a sparse tensor. For detailed explanation of each
26532653
/// field please refer to lite/schema/schema.fbs.
2654-
class TfLiteSparsity extends ffi.Struct {
2654+
final class TfLiteSparsity extends ffi.Struct {
26552655
external ffi.Pointer<TfLiteIntArray> traversal_order;
26562656

26572657
external ffi.Pointer<TfLiteIntArray> block_map;
@@ -2663,7 +2663,7 @@ class TfLiteSparsity extends ffi.Struct {
26632663
}
26642664

26652665
/// Metadata to encode each dimension in a sparse tensor.
2666-
class TfLiteDimensionMetadata extends ffi.Struct {
2666+
final class TfLiteDimensionMetadata extends ffi.Struct {
26672667
@ffi.Int32()
26682668
external int format;
26692669

@@ -2684,7 +2684,7 @@ abstract class TfLiteDimensionType {
26842684
/// A structure representing an instance of a node.
26852685
/// This structure only exhibits the inputs, outputs, user defined data and some
26862686
/// node properties (like statefulness), not other features like the type.
2687-
class TfLiteNode extends ffi.Struct {
2687+
final class TfLiteNode extends ffi.Struct {
26882688
/// Inputs to this node expressed as indices into the simulator's tensors.
26892689
external ffi.Pointer<TfLiteIntArray> inputs;
26902690

@@ -2724,7 +2724,7 @@ class TfLiteNode extends ffi.Struct {
27242724
external bool might_have_side_effect;
27252725
}
27262726

2727-
class TfLiteRegistration extends ffi.Struct {
2727+
final class TfLiteRegistration extends ffi.Struct {
27282728
/// Initializes the op from serialized data.
27292729
/// Called only *once* for the lifetime of the op, so any one-time allocations
27302730
/// should be made here (unless they depend on tensor sizes).
@@ -2810,14 +2810,14 @@ class TfLiteRegistration extends ffi.Struct {
28102810
external ffi.Pointer<TfLiteRegistrationExternal> registration_external;
28112811
}
28122812

2813-
class TfLiteRegistrationExternal extends ffi.Opaque {}
2813+
final class TfLiteRegistrationExternal extends ffi.Opaque {}
28142814

28152815
/// An external context is a collection of information unrelated to the TF Lite
28162816
/// framework, but useful to a subset of the ops. TF Lite knows very little
28172817
/// about the actual contexts, but it keeps a list of them, and is able to
28182818
/// refresh them if configurations like the number of recommended threads
28192819
/// change.
2820-
class TfLiteExternalContext extends ffi.Struct {
2820+
final class TfLiteExternalContext extends ffi.Struct {
28212821
@ffi.Int32()
28222822
external int type;
28232823

@@ -2852,7 +2852,7 @@ abstract class TfLiteExternalContextType {
28522852
/// `TfLiteNode` of the delegate node.
28532853
///
28542854
/// See also the `CreateDelegateParams` function in `interpreter.cc` details.
2855-
class TfLiteDelegateParams extends ffi.Struct {
2855+
final class TfLiteDelegateParams extends ffi.Struct {
28562856
external ffi.Pointer<TfLiteDelegate> delegate;
28572857

28582858
external ffi.Pointer<TfLiteIntArray> nodes_to_replace;
@@ -2866,7 +2866,7 @@ class TfLiteDelegateParams extends ffi.Struct {
28662866
/// of information required for a kernel to run during TfLiteRegistration::Eval.
28672867
/// TODO(b/160955687): Move this field into TF_LITE_STATIC_MEMORY when TFLM
28682868
/// builds with this flag by default internally.
2869-
class TfLiteEvalTensor extends ffi.Struct {
2869+
final class TfLiteEvalTensor extends ffi.Struct {
28702870
/// A union of data pointers. The appropriate type should be used for a typed
28712871
/// tensor based on `type`.
28722872
external TfLitePtrUnion data;
@@ -2891,7 +2891,7 @@ class TfLiteEvalTensor extends ffi.Struct {
28912891
/// the same as with `TfLiteDelegate`.
28922892
///
28932893
/// WARNING: This is an experimental interface that is subject to change.
2894-
class TfLiteOpaqueDelegateBuilder extends ffi.Struct {
2894+
final class TfLiteOpaqueDelegateBuilder extends ffi.Struct {
28952895
/// Data that delegate needs to identify itself. This data is owned by the
28962896
/// delegate. The delegate is owned in the user code, so the delegate is
28972897
/// responsible for deallocating this when it is destroyed.
@@ -2939,13 +2939,13 @@ class TfLiteOpaqueDelegateBuilder extends ffi.Struct {
29392939
external int flags;
29402940
}
29412941

2942-
class TfLiteOpaqueContext extends ffi.Opaque {}
2942+
final class TfLiteOpaqueContext extends ffi.Opaque {}
29432943

2944-
class TfLiteOpaqueDelegateStruct extends ffi.Opaque {}
2944+
final class TfLiteOpaqueDelegateStruct extends ffi.Opaque {}
29452945

2946-
class TfLiteOpaqueTensor extends ffi.Opaque {}
2946+
final class TfLiteOpaqueTensor extends ffi.Opaque {}
29472947

2948-
class TfLiteInterpreter extends ffi.Opaque {}
2948+
final class TfLiteInterpreter extends ffi.Opaque {}
29492949

29502950
/// The enum for builtin operators.
29512951
/// Note: CUSTOM, DELEGATE, and PLACEHOLDER_FOR_GREATER_OP_CODES are 3 special
@@ -3112,18 +3112,18 @@ abstract class TfLiteBuiltinOperator {
31123112
static const int kTfLiteBuiltinSign = 158;
31133113
}
31143114

3115-
class TfLiteOpaqueNode extends ffi.Opaque {}
3115+
final class TfLiteOpaqueNode extends ffi.Opaque {}
31163116

31173117
typedef va_list = __builtin_va_list;
31183118
typedef __builtin_va_list = ffi.Pointer<ffi.Char>;
31193119

3120-
class TfLiteSignatureRunner extends ffi.Opaque {}
3120+
final class TfLiteSignatureRunner extends ffi.Opaque {}
31213121

31223122
/// Old version of `TfLiteRegistration` to maintain binary backward
31233123
/// compatibility.
31243124
/// WARNING: This structure is deprecated / not an official part of the API.
31253125
/// It should be only used for binary backward compatibility.
3126-
class TfLiteRegistration_V1 extends ffi.Struct {
3126+
final class TfLiteRegistration_V1 extends ffi.Struct {
31273127
external ffi.Pointer<
31283128
ffi.NativeFunction<
31293129
ffi.Pointer<ffi.Void> Function(ffi.Pointer<TfLiteContext> context,
@@ -3167,7 +3167,7 @@ abstract class TfLiteCoreMlDelegateEnabledDevices {
31673167
static const int TfLiteCoreMlDelegateAllDevices = 1;
31683168
}
31693169

3170-
class TfLiteCoreMlDelegateOptions extends ffi.Struct {
3170+
final class TfLiteCoreMlDelegateOptions extends ffi.Struct {
31713171
/// Only create delegate when Neural Engine is available on the device.
31723172
@ffi.Int32()
31733173
external int enabled_devices;
@@ -3211,7 +3211,7 @@ abstract class TFLGpuDelegateWaitType {
32113211

32123212
/// Creates a new delegate instance that need to be destroyed with
32133213
/// DeleteFlowDelegate when delegate is no longer used by tflite.
3214-
class TFLGpuDelegateOptions extends ffi.Struct {
3214+
final class TFLGpuDelegateOptions extends ffi.Struct {
32153215
/// Allows to quantify tensors, downcast values, process in float16 etc.
32163216
@ffi.Bool()
32173217
external bool allow_precision_loss;
@@ -3224,9 +3224,9 @@ class TFLGpuDelegateOptions extends ffi.Struct {
32243224
external bool enable_quantization;
32253225
}
32263226

3227-
class TfLiteXNNPackDelegateWeightsCache extends ffi.Opaque {}
3227+
final class TfLiteXNNPackDelegateWeightsCache extends ffi.Opaque {}
32283228

3229-
class TfLiteXNNPackDelegateOptions extends ffi.Struct {
3229+
final class TfLiteXNNPackDelegateOptions extends ffi.Struct {
32303230
/// Number of threads to use in the thread pool.
32313231
/// 0 or negative value means no thread pool used.
32323232
@ffi.Int32()
@@ -3300,7 +3300,7 @@ abstract class TfLiteGpuExperimentalFlags {
33003300
/// IMPORTANT: Always use TfLiteGpuDelegateOptionsV2Default() method to create
33013301
/// new instance of TfLiteGpuDelegateOptionsV2, otherwise every new added option
33023302
/// may break inference.
3303-
class TfLiteGpuDelegateOptionsV2 extends ffi.Struct {
3303+
final class TfLiteGpuDelegateOptionsV2 extends ffi.Struct {
33043304
/// When set to zero, computations are carried out in maximal possible
33053305
/// precision. Otherwise, the GPU may quantify tensors, downcast values,
33063306
/// process in FP16 to increase performance. For most models precision loss is

0 commit comments

Comments
 (0)