Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 2c8c1d7

Browse files
committed
Updates on descriptions about reading builtin code
1 parent 46cf4aa commit 2c8c1d7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

rfcs/20200901-tflite-builtin-code-extension.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ enum BuiltinOperator : byte {
3636
```
3737

3838
TensorFlow Lite keeps extending to support more domains in ML and users require
39-
more builtin operators to increase ML model coverage on device, for example,
40-
Hash table support and so on.
39+
more builtin operators to increase ML model coverage on device, for example Hash
40+
table support and so on.
4141

4242
### Compatibility issues
4343

@@ -84,17 +84,18 @@ table OperatorCode {
8484
// This field is introduced for resolving op builtin operator code shortage problem
8585
// (the original BuiltinOperator enum field was represented as a byte).
8686
// This field will be used when the value of the extended builtin_code field
87-
// has greater than BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES.
87+
// is greater than BuiltinOperator_PLACEHOLDER_FOR_GREATER_OP_CODES.
8888
builtin_code:BuiltinOperator;
8989
}
9090
9191
```
9292

9393
### How to Read `builtin_code`
9494

95-
The builtin operator code value will co-exist in the two fields. Some old schema
96-
version 3 models will have the default value in the new field. Always the
97-
maximum value of the two fields always will be the correct value.
95+
The builtin operator code value will co-exist in the two fields. Old schema
96+
version 3 models will have the default value in the new field. For those old
97+
schema models, the `deprecated_builtin_code` field should be read when the
98+
default value is set in the new `builtin_code` field.
9899

99100
```
100101
BuiltinOperator builtin_code = (op_code->builtin_code ? op_code->builtin_code
@@ -118,9 +119,7 @@ The TensorFlow Lite library built after the proposal will read the existing
118119
The new `builtin_code` field is not available in the version 3 models. Flatbuffer
119120
library will feed zero value, which is the default value in the version 3a schema. The
120121
actual builtin operator code value will exist in the deprecated, renamed
121-
`deprecated_builtin_code` field. At the same time, it implies that
122-
`deprecated_builtin_code` >= `builtin_code` and the maximum value of the two
123-
fields will be same as `deprecated_builtin_code'.
122+
`deprecated_builtin_code` field.
124123

125124
##### Compatibility with old TensorFlow Lite libraries
126125

0 commit comments

Comments
 (0)