Merge pull request #38201 from wwwind:docs_version
PiperOrigin-RevId: 305128782 Change-Id: Iaa705edf903b9e45aaa73390111461c5a2f1bd28
This commit is contained in:
commit
fc94412b39
@ -63,11 +63,14 @@ table Conv2DOptions {
|
||||
}
|
||||
```
|
||||
|
||||
The file `lite/schema/schema_generated.h` should be re-generated for the new
|
||||
schema.
|
||||
|
||||
### Change C Structures and Kernel Implementation
|
||||
|
||||
In TensorFlow Lite, the kernel implementation is decoupled from
|
||||
FlatBuffer definition. The kernels read the parameter from C structures defined
|
||||
in `lite/builtin_op_data.h`.
|
||||
In TensorFlow Lite, the kernel implementation is decoupled from FlatBuffer
|
||||
definition. The kernels read the parameter from C structures defined in
|
||||
`lite/c/builtin_op_data.h`.
|
||||
|
||||
The original convolution parameter is as follows:
|
||||
|
||||
@ -102,7 +105,8 @@ from the C structures. The details are omitted here.
|
||||
|
||||
### Change the FlatBuffer Reading Code
|
||||
|
||||
The logic to read FlatBuffer and produce C structure is in `lite/model.cc`.
|
||||
The logic to read FlatBuffer and produce C structure is in
|
||||
`lite/core/api/flatbuffer_conversions.cc`.
|
||||
|
||||
Update the file to handle the new parameters, as shown below:
|
||||
|
||||
@ -162,8 +166,8 @@ execute the op. In this example, it means:
|
||||
* Populate version=1 when dilation factors are all 1.
|
||||
* Populate version=2 otherwise.
|
||||
|
||||
To do this, you need to override `GetVersion` function for the operator class in
|
||||
`lite/tools/versioning/op_version.cc`.
|
||||
To do this, you need to override `GetBuiltinOperatorVersion` function for the
|
||||
operator class in `lite/tools/versioning/op_version.cc`.
|
||||
|
||||
For ops with only one version, the `GetVersion` function is defined as:
|
||||
|
||||
@ -191,8 +195,7 @@ The last step is to add the new version info into the operator version map. This
|
||||
step is required because we need generate the model's minimum required runtime
|
||||
version based on this version map.
|
||||
|
||||
To do this, you need to add a new map entry in
|
||||
`lite/tools/versioning/op_version.cc`.
|
||||
To do this, you need to add a new map entry in `lite/toco/tflite/op_version.cc`.
|
||||
|
||||
In this example, it means you need to add the following into `op_version_map`:
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user