├── .github └── workflows │ ├── build.yaml │ ├── publish.yml │ └── stale.yml ├── .gitignore ├── 3rdparty └── schema.fbs ├── LICENSE ├── README.md ├── _config.yml ├── assets ├── disclaimer.eml └── tests │ ├── mobilenet_v1_1.0_224_quant.tflite │ └── mobilenet_v2_1.0_224.tflite ├── docs ├── ATan2Options.html ├── AbsOptions.html ├── ActivationFunctionType.html ├── AddNOptions.html ├── AddOptions.html ├── ArgMaxOptions.html ├── ArgMinOptions.html ├── AssignVariableOptions.html ├── BatchMatMulOptions.html ├── BatchToSpaceNDOptions.html ├── BidirectionalSequenceLSTMOptions.html ├── BidirectionalSequenceRNNOptions.html ├── BitcastOptions.html ├── BitwiseXorOptions.html ├── BroadcastToOptions.html ├── BucketizeOptions.html ├── Buffer.html ├── BuiltinOperator.html ├── BuiltinOptions.html ├── BuiltinOptions2.html ├── CallOnceOptions.html ├── CallOptions.html ├── CastOptions.html ├── CombinerType.html ├── ConcatEmbeddingsOptions.html ├── ConcatenationOptions.html ├── Conv2DOptions.html ├── Conv3DOptions.html ├── CosOptions.html ├── CumsumOptions.html ├── CustomOptionsFormat.html ├── CustomQuantization.html ├── DensifyOptions.html ├── DepthToSpaceOptions.html ├── DepthwiseConv2DOptions.html ├── DequantizeOptions.html ├── DilateOptions.html ├── DimensionMetadata.html ├── DimensionType.html ├── DivOptions.html ├── DynamicUpdateSliceOptions.html ├── EmbeddingLookupSparseOptions.html ├── EqualOptions.html ├── ExpOptions.html ├── ExpandDimsOptions.html ├── FakeQuantOptions.html ├── FillOptions.html ├── FloorDivOptions.html ├── FloorModOptions.html ├── FullyConnectedOptions.html ├── FullyConnectedOptionsWeightsFormat.html ├── GatherNdOptions.html ├── GatherOptions.html ├── GeluOptions.html ├── GreaterEqualOptions.html ├── GreaterOptions.html ├── HardSwishOptions.html ├── HashtableFindOptions.html ├── HashtableImportOptions.html ├── HashtableOptions.html ├── HashtableSizeOptions.html ├── IfOptions.html ├── Int32Vector.html ├── L2NormOptions.html ├── LSHProjectionOptions.html ├── LSHProjectionType.html ├── LSTMKernelType.html ├── LSTMOptions.html ├── LeakyReluOptions.html ├── LessEqualOptions.html ├── LessOptions.html ├── LocalResponseNormalizationOptions.html ├── LogSoftmaxOptions.html ├── LogicalAndOptions.html ├── LogicalNotOptions.html ├── LogicalOrOptions.html ├── MatrixDiagOptions.html ├── MatrixSetDiagOptions.html ├── MaximumMinimumOptions.html ├── Metadata.html ├── MirrorPadMode.html ├── MirrorPadOptions.html ├── Model.html ├── MulOptions.html ├── NegOptions.html ├── NonMaxSuppressionV4Options.html ├── NonMaxSuppressionV5Options.html ├── NotEqualOptions.html ├── OneHotOptions.html ├── Operator.html ├── OperatorCode.html ├── PackOptions.html ├── PadOptions.html ├── PadV2Options.html ├── Padding.html ├── Pool2DOptions.html ├── PowOptions.html ├── QuantizationDetails.html ├── QuantizationParameters.html ├── QuantizeOptions.html ├── RNNOptions.html ├── RandomOptions.html ├── RangeOptions.html ├── RankOptions.html ├── ReadVariableOptions.html ├── ReduceWindowFunction.html ├── ReduceWindowOptions.html ├── ReducerOptions.html ├── ReshapeOptions.html ├── ResizeBilinearOptions.html ├── ResizeNearestNeighborOptions.html ├── ReverseSequenceOptions.html ├── ReverseV2Options.html ├── Rfft2dOptions.html ├── RightShiftOptions.html ├── RngAlgorithm.html ├── SVDFOptions.html ├── ScatterNdOptions.html ├── SegmentSumOptions.html ├── SelectOptions.html ├── SelectV2Options.html ├── SequenceRNNOptions.html ├── ShapeOptions.html ├── SignOptions.html ├── SignatureDef.html ├── SkipGramOptions.html ├── SliceOptions.html ├── SoftmaxOptions.html ├── SpaceToBatchNDOptions.html ├── SpaceToDepthOptions.html ├── SparseIndexVector.html ├── SparseToDenseOptions.html ├── SparsityParameters.html ├── SplitOptions.html ├── SplitVOptions.html ├── SquareOptions.html ├── SquaredDifferenceOptions.html ├── SqueezeOptions.html ├── StableHLOCompositeOptions.html ├── StablehloBroadcastInDimOptions.html ├── StablehloCompareOptions.html ├── StablehloComparisonDirection.html ├── StablehloComparisonType.html ├── StablehloConcatenateOptions.html ├── StablehloConvolutionOptions.html ├── StablehloCustomCallOptions.html ├── StablehloDotGeneralOptions.html ├── StablehloDynamicSliceOptions.html ├── StablehloGatherOptions.html ├── StablehloIotaOptions.html ├── StablehloPadOptions.html ├── StablehloPrecisionConfig.html ├── StablehloReduceOptions.html ├── StablehloReduceWindowOptions.html ├── StablehloRngBitGeneratorOptions.html ├── StablehloScatterOptions.html ├── StablehloShiftLeftOptions.html ├── StablehloSliceOptions.html ├── StablehloSortOptions.html ├── StablehloTransposeOptions.html ├── StablehloWhileOptions.html ├── StridedSliceOptions.html ├── SubGraph.html ├── SubOptions.html ├── Tensor.html ├── TensorMap.html ├── TensorType.html ├── TileOptions.html ├── TopKV2Options.html ├── TransposeConvOptions.html ├── TransposeOptions.html ├── Uint16Vector.html ├── Uint8Vector.html ├── UnidirectionalSequenceLSTMOptions.html ├── UniqueOptions.html ├── UnpackOptions.html ├── UnsortedSegmentMaxOptions.html ├── UnsortedSegmentMinOptions.html ├── UnsortedSegmentProdOptions.html ├── UnsortedSegmentSumOptions.html ├── VarHandleOptions.html ├── VariantSubType.html ├── WhereOptions.html ├── WhileOptions.html ├── ZerosLikeOptions.html ├── index.html └── utils.html ├── pyproject.toml ├── requirements.txt ├── scripts ├── build-wheel.sh ├── gen-doc.sh ├── gen-op-list.py ├── source-me.sh ├── test-all.sh ├── update-importing.py ├── update-schema.sh └── upload-pip.sh ├── setup.cfg ├── tests ├── test_easy_import.py ├── test_mobilenet.py ├── test_original_import.py └── test_utils.py └── tflite ├── ATan2Options.py ├── AbsOptions.py ├── ActivationFunctionType.py ├── AddNOptions.py ├── AddOptions.py ├── ArgMaxOptions.py ├── ArgMinOptions.py ├── AssignVariableOptions.py ├── BatchMatMulOptions.py ├── BatchToSpaceNDOptions.py ├── BidirectionalSequenceLSTMOptions.py ├── BidirectionalSequenceRNNOptions.py ├── BitcastOptions.py ├── BitwiseXorOptions.py ├── BroadcastToOptions.py ├── BucketizeOptions.py ├── Buffer.py ├── BuiltinOperator.py ├── BuiltinOptions.py ├── BuiltinOptions2.py ├── CallOnceOptions.py ├── CallOptions.py ├── CastOptions.py ├── CombinerType.py ├── ConcatEmbeddingsOptions.py ├── ConcatenationOptions.py ├── Conv2DOptions.py ├── Conv3DOptions.py ├── CosOptions.py ├── CumsumOptions.py ├── CustomOptionsFormat.py ├── CustomQuantization.py ├── DensifyOptions.py ├── DepthToSpaceOptions.py ├── DepthwiseConv2DOptions.py ├── DequantizeOptions.py ├── DilateOptions.py ├── DimensionMetadata.py ├── DimensionType.py ├── DivOptions.py ├── DynamicUpdateSliceOptions.py ├── EmbeddingLookupSparseOptions.py ├── EqualOptions.py ├── ExpOptions.py ├── ExpandDimsOptions.py ├── FakeQuantOptions.py ├── FillOptions.py ├── FloorDivOptions.py ├── FloorModOptions.py ├── FullyConnectedOptions.py ├── FullyConnectedOptionsWeightsFormat.py ├── GatherNdOptions.py ├── GatherOptions.py ├── GeluOptions.py ├── GreaterEqualOptions.py ├── GreaterOptions.py ├── HardSwishOptions.py ├── HashtableFindOptions.py ├── HashtableImportOptions.py ├── HashtableOptions.py ├── HashtableSizeOptions.py ├── IfOptions.py ├── Int32Vector.py ├── L2NormOptions.py ├── LSHProjectionOptions.py ├── LSHProjectionType.py ├── LSTMKernelType.py ├── LSTMOptions.py ├── LeakyReluOptions.py ├── LessEqualOptions.py ├── LessOptions.py ├── LocalResponseNormalizationOptions.py ├── LogSoftmaxOptions.py ├── LogicalAndOptions.py ├── LogicalNotOptions.py ├── LogicalOrOptions.py ├── MatrixDiagOptions.py ├── MatrixSetDiagOptions.py ├── MaximumMinimumOptions.py ├── Metadata.py ├── MirrorPadMode.py ├── MirrorPadOptions.py ├── Model.py ├── MulOptions.py ├── NegOptions.py ├── NonMaxSuppressionV4Options.py ├── NonMaxSuppressionV5Options.py ├── NotEqualOptions.py ├── OneHotOptions.py ├── Operator.py ├── OperatorCode.py ├── PackOptions.py ├── PadOptions.py ├── PadV2Options.py ├── Padding.py ├── Pool2DOptions.py ├── PowOptions.py ├── QuantizationDetails.py ├── QuantizationParameters.py ├── QuantizeOptions.py ├── RNNOptions.py ├── RandomOptions.py ├── RangeOptions.py ├── RankOptions.py ├── ReadVariableOptions.py ├── ReduceWindowFunction.py ├── ReduceWindowOptions.py ├── ReducerOptions.py ├── ReshapeOptions.py ├── ResizeBilinearOptions.py ├── ResizeNearestNeighborOptions.py ├── ReverseSequenceOptions.py ├── ReverseV2Options.py ├── Rfft2dOptions.py ├── RightShiftOptions.py ├── RngAlgorithm.py ├── SVDFOptions.py ├── ScatterNdOptions.py ├── SegmentSumOptions.py ├── SelectOptions.py ├── SelectV2Options.py ├── SequenceRNNOptions.py ├── ShapeOptions.py ├── SignOptions.py ├── SignatureDef.py ├── SkipGramOptions.py ├── SliceOptions.py ├── SoftmaxOptions.py ├── SpaceToBatchNDOptions.py ├── SpaceToDepthOptions.py ├── SparseIndexVector.py ├── SparseToDenseOptions.py ├── SparsityParameters.py ├── SplitOptions.py ├── SplitVOptions.py ├── SquareOptions.py ├── SquaredDifferenceOptions.py ├── SqueezeOptions.py ├── StableHLOCompositeOptions.py ├── StablehloBroadcastInDimOptions.py ├── StablehloCompareOptions.py ├── StablehloComparisonDirection.py ├── StablehloComparisonType.py ├── StablehloConcatenateOptions.py ├── StablehloConvolutionOptions.py ├── StablehloCustomCallOptions.py ├── StablehloDotGeneralOptions.py ├── StablehloDynamicSliceOptions.py ├── StablehloGatherOptions.py ├── StablehloIotaOptions.py ├── StablehloPadOptions.py ├── StablehloPrecisionConfig.py ├── StablehloReduceOptions.py ├── StablehloReduceWindowOptions.py ├── StablehloRngBitGeneratorOptions.py ├── StablehloScatterOptions.py ├── StablehloShiftLeftOptions.py ├── StablehloSliceOptions.py ├── StablehloSortOptions.py ├── StablehloTransposeOptions.py ├── StablehloWhileOptions.py ├── StridedSliceOptions.py ├── SubGraph.py ├── SubOptions.py ├── Tensor.py ├── TensorMap.py ├── TensorType.py ├── TileOptions.py ├── TopKV2Options.py ├── TransposeConvOptions.py ├── TransposeOptions.py ├── Uint16Vector.py ├── Uint8Vector.py ├── UnidirectionalSequenceLSTMOptions.py ├── UniqueOptions.py ├── UnpackOptions.py ├── UnsortedSegmentMaxOptions.py ├── UnsortedSegmentMinOptions.py ├── UnsortedSegmentProdOptions.py ├── UnsortedSegmentSumOptions.py ├── VarHandleOptions.py ├── VariantSubType.py ├── WhereOptions.py ├── WhileOptions.py ├── ZerosLikeOptions.py ├── __init__.py └── utils.py /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | 7 | test: 8 | name: Build and Test 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Set up Python 3.8 15 | uses: actions/setup-python@v2 16 | with: 17 | python-version: 3.8 18 | 19 | - name: Update pip 20 | run: python -m pip install --upgrade pip 21 | 22 | - name: Build package 23 | run: scripts/build-wheel.sh 24 | shell: bash 25 | 26 | - name: Install package 27 | run: pip install -U assets/dist/tflite-*.whl 28 | 29 | - name: Install development dependencies 30 | run: pip install -r requirements.txt 31 | 32 | - name: Testing 33 | run: pytest 34 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | # This workflows will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | name: Upload Python Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | deploy: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Set up Python 18 | uses: actions/setup-python@v2 19 | with: 20 | python-version: '3.x' 21 | 22 | - name: Install dependencies 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install -r requirements.txt 26 | 27 | - name: Build package 28 | run: scripts/build-wheel.sh 29 | shell: bash 30 | 31 | - name: Publish 32 | env: 33 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 34 | TWINE_PASSWORD: ${{ secrets.PYPI_RELEASE_TOKEN }} 35 | run: | 36 | pip install twine 37 | twine upload --verbose assets/dist/* 38 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale issues" 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | 6 | jobs: 7 | stale: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/stale@v3 11 | with: 12 | repo-token: ${{ secrets.GITHUB_TOKEN }} 13 | days-before-stale: 30 14 | days-before-close: 14 15 | stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 14 days.' 16 | stale-issue-label: 'stale' 17 | exempt-issue-labels: 'Story,help wanted' 18 | stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 14 days.' 19 | stale-pr-label: 'stale' 20 | exempt-pr-labels: 'Story,help wanted' 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | 106 | # tflite 107 | *.tflite 108 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /assets/tests/mobilenet_v1_1.0_224_quant.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenhuaw-me/tflite/ff51a717c065c44da3e35bc0a1b1b0a50bfeb572/assets/tests/mobilenet_v1_1.0_224_quant.tflite -------------------------------------------------------------------------------- /assets/tests/mobilenet_v2_1.0_224.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenhuaw-me/tflite/ff51a717c065c44da3e35bc0a1b1b0a50bfeb572/assets/tests/mobilenet_v2_1.0_224.tflite -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhenhuaw-me/tflite/ff51a717c065c44da3e35bc0a1b1b0a50bfeb572/pyproject.toml -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | build 2 | GitPython 3 | flatbuffers 4 | numpy 5 | pdoc3 6 | pytest 7 | twine 8 | -------------------------------------------------------------------------------- /scripts/build-wheel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$(uname -s)" == "Darwin" ]; then 4 | root_dir=$(dirname $(dirname $(greadlink -f $0}))) 5 | else 6 | root_dir=$(dirname $(dirname $(readlink -f $0}))) 7 | fi 8 | rm -f ${root_dir}/assets/dist/tflite-*.whl 9 | 10 | pip install build flatbuffers numpy 11 | 12 | python -m build --outdir ${root_dir}/assets/dist 13 | rm -rf ${root_dir}/tflite.egg-info 14 | rm -rf ${root_dir}/build 15 | -------------------------------------------------------------------------------- /scripts/gen-doc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$(uname -s)" == "Darwin" ]; then 4 | root_dir=$(dirname $(dirname $(greadlink -f $0}))) 5 | else 6 | root_dir=$(dirname $(dirname $(readlink -f $0}))) 7 | fi 8 | doc_dir=${root_dir}/docs 9 | proj_dir=${root_dir}/tflite 10 | 11 | rm -rf ${doc_dir} 12 | pdoc -f --html -o ${doc_dir} ${proj_dir} tflite 13 | mv ${doc_dir}/tflite/* ${doc_dir} 14 | rmdir ${doc_dir}/tflite 15 | 16 | -------------------------------------------------------------------------------- /scripts/gen-op-list.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import git 5 | 6 | def genOpcode2Name(file_path): 7 | with open(file_path, 'r') as f: 8 | txt = f.read() 9 | lines = txt.split('\n') 10 | lines = [line for line in lines if '=' in line] 11 | types = [line.split('=')[0].strip() for line in lines] 12 | dict_str = ["BUILTIN_OPCODE2NAME = {\n"] 13 | for i in range(len(types)): 14 | dict_str.append(" " + str(i) + ": '" + types[i] + "',\n") 15 | dict_str.append("}\n") 16 | return dict_str 17 | 18 | def commitChange(repo_dir, the_file): 19 | with git.Repo(repo_dir) as repo: 20 | if len(repo.git.diff(the_file)) == 0: 21 | print("No change, skip commit...") 22 | exit(0) 23 | input_str = input("Will commit the utils.py change, continue [Y|N]? ") 24 | if input_str == 'Y': 25 | repo.git.add(the_file) 26 | repo.index.commit('Auto-generate tflite/utils.py to new opcode to name mapping') 27 | 28 | 29 | def main(): 30 | root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 31 | src_fpath = os.path.join(root_dir, 'tflite', 'BuiltinOperator.py') 32 | dict_str = genOpcode2Name(src_fpath) 33 | 34 | dest_fpath = os.path.join(root_dir, 'tflite', 'utils.py') 35 | 36 | # read the original file 37 | BEGIN_TAG = "########################## BELOW ARE AUTO-GENERATED ##########################\n" 38 | END_TAG = "########################## ABOVE ARE AUTO-GENERATED ##########################\n" 39 | lines = open(dest_fpath, 'r').readlines() 40 | begin_index = lines.index(BEGIN_TAG) 41 | end_index = lines.index(END_TAG) 42 | 43 | new_lines = lines[:begin_index+1] + dict_str + lines[end_index:] 44 | with open(dest_fpath, 'w') as f: 45 | for line in new_lines: 46 | f.write(line) 47 | 48 | commitChange(root_dir, dest_fpath) 49 | 50 | print("All done!") 51 | 52 | 53 | if __name__ == '__main__': 54 | main() 55 | -------------------------------------------------------------------------------- /scripts/source-me.sh: -------------------------------------------------------------------------------- 1 | echo "Tip: must be sourced under root directory of the repo!" 2 | export PYTHONPATH=$(pwd):${PYTHONPATH} 3 | -------------------------------------------------------------------------------- /scripts/test-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$(uname -s)" == "Darwin" ]; then 4 | root_dir=$(dirname $(dirname $(greadlink -f $0}))) 5 | else 6 | root_dir=$(dirname $(dirname $(readlink -f $0}))) 7 | fi 8 | 9 | # build and install the package 10 | ${root_dir}/tools/4-build.sh 11 | pip install -U ${root_dir}/assets/dist/tflite-*.whl 12 | 13 | echo -e "\nTesting: original import..." 14 | python ${root_dir}/tests/test_original_import.py 15 | if [ $? -ne 0 ]; then 16 | echo "FAIL!" 17 | exit 1 18 | else 19 | echo "PASS!" 20 | fi 21 | 22 | echo -e "\nTesting: easy import..." 23 | python ${root_dir}/tests/test_easy_import.py 24 | if [ $? -ne 0 ]; then 25 | echo "FAIL!" 26 | exit 1 27 | else 28 | echo "PASS!" 29 | fi 30 | 31 | echo -e "\nTesting: mobilenet example..." 32 | python ${root_dir}/tests/mobilenet_example.py 33 | if [ $? -ne 0 ]; then 34 | echo "FAIL!" 35 | exit 1 36 | else 37 | echo "PASS!" 38 | fi 39 | -------------------------------------------------------------------------------- /scripts/update-importing.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import git 5 | """Auto-generate the submodule importing from `tflite/tflite`""" 6 | 7 | here = os.path.abspath(os.path.dirname(__file__)) 8 | repo_dir = os.path.abspath(os.path.join(here, '..')) 9 | submodule_dir = os.path.join(repo_dir, 'tflite') 10 | the_file = os.path.join(repo_dir, 'tflite/__init__.py') 11 | 12 | BEGIN_TAG = "########################## BELOW ARE AUTO-GENERATED ##########################\n" 13 | END_TAG = "########################## ABOVE ARE AUTO-GENERATED ##########################\n" 14 | 15 | # the generated import lines 16 | pys = [ f[:-3] for f in sorted(os.listdir(submodule_dir)) \ 17 | if os.path.isfile(os.path.join(submodule_dir, f)) and \ 18 | f.endswith('.py') and f != '__init__.py'] 19 | imports = [ "from tflite.%s import *\n" % py for py in pys ] 20 | 21 | # read the original file 22 | lines = open(the_file, 'r').readlines() 23 | begin_index = lines.index(BEGIN_TAG) 24 | end_index = lines.index(END_TAG) 25 | 26 | # write the new file 27 | new_lines = lines[:begin_index+1] + imports + lines[end_index:] 28 | with open(the_file, 'w') as f: 29 | for line in new_lines: 30 | f.write(line) 31 | 32 | # commit change? 33 | with git.Repo(repo_dir) as repo: 34 | if len(repo.git.diff(the_file)) == 0: 35 | print("No change, skip commit...") 36 | exit(0) 37 | input_str = input("Will commit the __init__.py change, continue [Y|N]? ") 38 | if input_str == 'Y': 39 | repo.git.add(the_file) 40 | repo.index.commit('Auto-generate tflite/__init__.py to new schema.fbs') 41 | 42 | -------------------------------------------------------------------------------- /scripts/update-schema.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # which version? 4 | read -p "Which version of TensorFlow would you like to obtain the schema (\"v1.14.0\" for example): " version 5 | if [ -z ${version} ]; then 6 | exit 1 7 | fi 8 | read -p "Going to obtain schema from version \"${version}\", continue? [Y|N] " input_str 9 | if [ -z ${input_str} -o "${input_str}" != "Y" ]; then 10 | exit 0 11 | fi 12 | 13 | 14 | if [ "$(uname -s)" == "Darwin" ]; then 15 | root_dir=$(dirname $(dirname $(greadlink -f $0}))) 16 | else 17 | root_dir=$(dirname $(dirname $(readlink -f $0}))) 18 | fi 19 | 20 | schema_path="${root_dir}/3rdparty/schema.fbs" 21 | output_path="${root_dir}" 22 | 23 | # download schema.fbs 24 | repo_tree='https://raw.githubusercontent.com/tensorflow/tensorflow/refs/tags' 25 | file_path='tensorflow/compiler/mlir/lite/schema/schema.fbs' 26 | url="${repo_tree}/${version}/${file_path}" 27 | echo "Now, downloading from ${url}" 28 | curl ${url} -o "${schema_path}" 29 | 30 | # exit? 31 | if [ $(grep -q "404: Not Found" ${schema_path}) ]; then 32 | echo "Error: fail to download schema from ${url}" 33 | exit 1 34 | fi 35 | changed_lines=$(git diff ${schema_path} | wc -l) 36 | if [ ${changed_lines} -eq 0 ]; then 37 | echo "No change to schema, exit!" 38 | exit 0 39 | fi 40 | 41 | echo "Building flatbuffers python module in ${output_path}" 42 | rm -f ${root_dir}/tflite/*.py 43 | FBSC=$(which flatc) 44 | if [ ${?} -ne 0 ]; then 45 | echo "Error: Flatbuffer complier doesn't exist! Build with https://google.github.io/flatbuffers/flatbuffers_guide_building.html" 46 | exit 1 47 | fi 48 | ${FBSC} --python -o ${output_path} ${schema_path} 49 | # revert the __init__.py 50 | git checkout ${root_dir}/tflite/__init__.py 51 | git checkout ${root_dir}/tflite/utils.py 52 | 53 | # commit the schema change? 54 | read -p "Going to create a commit for these changes, continue? [Y|N] " input_str 55 | if [ -z ${input_str} -o "${input_str}" != "Y" ]; then 56 | exit 0 57 | fi 58 | git add ${schema_path} ${output_path}/tflite 59 | git commit -m "update schema.fbs and tflite module to ${version}" 60 | -------------------------------------------------------------------------------- /scripts/upload-pip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$(uname -s)" == "Darwin" ]; then 4 | root_dir=$(dirname $(dirname $(greadlink -f $0}))) 5 | else 6 | root_dir=$(dirname $(dirname $(readlink -f $0}))) 7 | fi 8 | 9 | ${root_dir}/tools/3-build.sh 10 | 11 | read -p "Will upload to test.pypi.org, for real publishment type \"Release\": " input_str 12 | if [ -z "${input_str}" -o ${input_str} != "Release" ]; then 13 | python3 -m twine upload \ 14 | --repository-url https://test.pypi.org/legacy/ \ 15 | ${root_dir}/assets/dist/tflite-* 16 | else 17 | read -p "Will publish the package, are you sure to continue [Y|N] ? " input_str 18 | if [ -n "${input_str}" -a ${input_str} = "Y" ]; then 19 | echo "Uploading..." 20 | python3 -m twine upload ${root_dir}/assets/dist/tflite-* 21 | fi 22 | fi 23 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name=tflite 3 | version = attr: tflite.__version__ 4 | description = Parsing TensorFlow Lite Models (*.tflite) Easily 5 | 6 | author = 王振华(Zhenhua WANG) 7 | author_email = hi@zhenhuaw.me 8 | url = https://zhenhuaw.me/tflite 9 | 10 | long_description = file: README.md 11 | long_description_content_type = text/markdown 12 | license = Apache License 2.0 13 | license_file = LICENSE 14 | keywords = tflite, tensorflow 15 | 16 | project_urls = 17 | Bug Reports = https://github.com/zhenhuaw-me/tflite/issues 18 | Source = https://github.com/zhenhuaw-me/tflite 19 | 20 | classifiers = 21 | Development Status :: 4 - Beta 22 | Programming Language :: Python :: 2 23 | Programming Language :: Python :: 2.7 24 | Programming Language :: Python :: 3 25 | Programming Language :: Python :: 3.5 26 | Programming Language :: Python :: 3.6 27 | Programming Language :: Python :: 3.7 28 | Environment :: Console 29 | Intended Audience :: Developers 30 | License :: OSI Approved :: Apache Software License 31 | Natural Language :: English 32 | Operating System :: OS Independent 33 | Topic :: Scientific/Engineering :: Artificial Intelligence 34 | 35 | 36 | [options] 37 | install_requires = 38 | flatbuffers 39 | numpy 40 | python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4 41 | packages = find: 42 | 43 | [bdist_wheel] 44 | # This flag says to generate wheels that support both Python 2 and Python 45 | # 3. If your code will not run unchanged on both Python 2 and 3, you will 46 | # need to generate separate wheels for each Python version that you 47 | # support. Removing this line (or setting universal to 0) will prevent 48 | # bdist_wheel from trying to make a universal wheel. For more see: 49 | # https://packaging.python.org/guides/distributing-packages-using-setuptools/#wheels 50 | universal=1 51 | -------------------------------------------------------------------------------- /tests/test_easy_import.py: -------------------------------------------------------------------------------- 1 | import os 2 | import tflite 3 | 4 | 5 | def test_import(): 6 | cur_dir = os.path.dirname(os.path.abspath(__file__)) 7 | tflm_dir = os.path.abspath(cur_dir + '/../assets/tests') 8 | tflm_name = 'mobilenet_v2_1.0_224.tflite' 9 | path = os.path.join(tflm_dir, tflm_name) 10 | with open(path, 'rb') as f: 11 | buf = f.read() 12 | model = tflite.Model.GetRootAsModel(buf, 0) 13 | assert(model.Version() == 3) 14 | 15 | 16 | if __name__ == '__main__': 17 | test_import() 18 | -------------------------------------------------------------------------------- /tests/test_original_import.py: -------------------------------------------------------------------------------- 1 | import os 2 | from tflite.Model import Model 3 | 4 | 5 | def test_import(): 6 | cur_dir = os.path.dirname(os.path.abspath(__file__)) 7 | tflm_dir = os.path.abspath(cur_dir + '/../assets/tests') 8 | tflm_name = 'mobilenet_v2_1.0_224.tflite' 9 | path = os.path.join(tflm_dir, tflm_name) 10 | with open(path, 'rb') as f: 11 | buf = f.read() 12 | model = Model.GetRootAsModel(buf, 0) 13 | assert(model.Version() == 3) 14 | 15 | 16 | if __name__ == '__main__': 17 | test_import() 18 | -------------------------------------------------------------------------------- /tests/test_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import tflite 3 | 4 | 5 | def test_opcode2name(): 6 | assert(tflite.opcode2name(0) == 'ADD') 7 | 8 | 9 | if __name__ == '__main__': 10 | test_opcode2name() 11 | -------------------------------------------------------------------------------- /tflite/ATan2Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ATan2Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ATan2Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsATan2Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ATan2OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ATan2Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ATan2OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ATan2OptionsStart(builder) 36 | 37 | def ATan2OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ATan2OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/AbsOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class AbsOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = AbsOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsAbsOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def AbsOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # AbsOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def AbsOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | AbsOptionsStart(builder) 36 | 37 | def AbsOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return AbsOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/ActivationFunctionType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class ActivationFunctionType(object): 6 | NONE = 0 7 | RELU = 1 8 | RELU_N1_TO_1 = 2 9 | RELU6 = 3 10 | TANH = 4 11 | SIGN_BIT = 5 12 | -------------------------------------------------------------------------------- /tflite/AddNOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class AddNOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = AddNOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsAddNOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def AddNOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # AddNOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def AddNOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | AddNOptionsStart(builder) 36 | 37 | def AddNOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return AddNOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/AddOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class AddOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = AddOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsAddOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def AddOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # AddOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # AddOptions 32 | def FusedActivationFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # AddOptions 39 | def PotScaleInt16(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 43 | return True 44 | 45 | def AddOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | AddOptionsStart(builder) 50 | 51 | def AddOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 52 | builder.PrependInt8Slot(0, fusedActivationFunction, 0) 53 | 54 | def AddFusedActivationFunction(builder, fusedActivationFunction): 55 | AddOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 56 | 57 | def AddOptionsAddPotScaleInt16(builder, potScaleInt16): 58 | builder.PrependBoolSlot(1, potScaleInt16, 1) 59 | 60 | def AddPotScaleInt16(builder, potScaleInt16): 61 | AddOptionsAddPotScaleInt16(builder, potScaleInt16) 62 | 63 | def AddOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return AddOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/ArgMaxOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ArgMaxOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ArgMaxOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsArgMaxOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ArgMaxOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ArgMaxOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ArgMaxOptions 32 | def OutputType(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def ArgMaxOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | ArgMaxOptionsStart(builder) 43 | 44 | def ArgMaxOptionsAddOutputType(builder, outputType): 45 | builder.PrependInt8Slot(0, outputType, 0) 46 | 47 | def AddOutputType(builder, outputType): 48 | ArgMaxOptionsAddOutputType(builder, outputType) 49 | 50 | def ArgMaxOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return ArgMaxOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/ArgMinOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ArgMinOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ArgMinOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsArgMinOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ArgMinOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ArgMinOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ArgMinOptions 32 | def OutputType(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def ArgMinOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | ArgMinOptionsStart(builder) 43 | 44 | def ArgMinOptionsAddOutputType(builder, outputType): 45 | builder.PrependInt8Slot(0, outputType, 0) 46 | 47 | def AddOutputType(builder, outputType): 48 | ArgMinOptionsAddOutputType(builder, outputType) 49 | 50 | def ArgMinOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return ArgMinOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/AssignVariableOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class AssignVariableOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = AssignVariableOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsAssignVariableOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def AssignVariableOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # AssignVariableOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def AssignVariableOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | AssignVariableOptionsStart(builder) 36 | 37 | def AssignVariableOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return AssignVariableOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/BatchToSpaceNDOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class BatchToSpaceNDOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = BatchToSpaceNDOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsBatchToSpaceNDOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def BatchToSpaceNDOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # BatchToSpaceNDOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def BatchToSpaceNDOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | BatchToSpaceNDOptionsStart(builder) 36 | 37 | def BatchToSpaceNDOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return BatchToSpaceNDOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/BitcastOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class BitcastOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = BitcastOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsBitcastOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def BitcastOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # BitcastOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def BitcastOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | BitcastOptionsStart(builder) 36 | 37 | def BitcastOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return BitcastOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/BitwiseXorOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class BitwiseXorOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = BitwiseXorOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsBitwiseXorOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def BitwiseXorOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # BitwiseXorOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def BitwiseXorOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | BitwiseXorOptionsStart(builder) 36 | 37 | def BitwiseXorOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return BitwiseXorOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/BroadcastToOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class BroadcastToOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = BroadcastToOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsBroadcastToOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def BroadcastToOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # BroadcastToOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def BroadcastToOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | BroadcastToOptionsStart(builder) 36 | 37 | def BroadcastToOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return BroadcastToOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/BuiltinOptions2.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class BuiltinOptions2(object): 6 | NONE = 0 7 | StablehloConcatenateOptions = 1 8 | StablehloBroadcastInDimOptions = 2 9 | StablehloSliceOptions = 3 10 | StablehloConvolutionOptions = 4 11 | StablehloCustomCallOptions = 5 12 | StablehloReduceOptions = 6 13 | StablehloScatterOptions = 7 14 | StablehloCompareOptions = 8 15 | StablehloDynamicSliceOptions = 9 16 | StablehloPadOptions = 10 17 | StablehloIotaOptions = 11 18 | StablehloDotGeneralOptions = 12 19 | StablehloReduceWindowOptions = 13 20 | StablehloSortOptions = 14 21 | StablehloWhileOptions = 15 22 | StablehloGatherOptions = 16 23 | StablehloTransposeOptions = 17 24 | DilateOptions = 18 25 | StablehloRngBitGeneratorOptions = 19 26 | ReduceWindowOptions = 20 27 | StableHLOCompositeOptions = 21 28 | StablehloShiftLeftOptions = 22 29 | -------------------------------------------------------------------------------- /tflite/CallOnceOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class CallOnceOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = CallOnceOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsCallOnceOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def CallOnceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # CallOnceOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # CallOnceOptions 32 | def InitSubgraphIndex(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def CallOnceOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | CallOnceOptionsStart(builder) 43 | 44 | def CallOnceOptionsAddInitSubgraphIndex(builder, initSubgraphIndex): 45 | builder.PrependInt32Slot(0, initSubgraphIndex, 0) 46 | 47 | def AddInitSubgraphIndex(builder, initSubgraphIndex): 48 | CallOnceOptionsAddInitSubgraphIndex(builder, initSubgraphIndex) 49 | 50 | def CallOnceOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return CallOnceOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/CallOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class CallOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = CallOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsCallOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def CallOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # CallOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # CallOptions 32 | def Subgraph(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def CallOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | CallOptionsStart(builder) 43 | 44 | def CallOptionsAddSubgraph(builder, subgraph): 45 | builder.PrependUint32Slot(0, subgraph, 0) 46 | 47 | def AddSubgraph(builder, subgraph): 48 | CallOptionsAddSubgraph(builder, subgraph) 49 | 50 | def CallOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return CallOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/CastOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class CastOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = CastOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsCastOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def CastOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # CastOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # CastOptions 32 | def InDataType(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # CastOptions 39 | def OutDataType(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def CastOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | CastOptionsStart(builder) 50 | 51 | def CastOptionsAddInDataType(builder, inDataType): 52 | builder.PrependInt8Slot(0, inDataType, 0) 53 | 54 | def AddInDataType(builder, inDataType): 55 | CastOptionsAddInDataType(builder, inDataType) 56 | 57 | def CastOptionsAddOutDataType(builder, outDataType): 58 | builder.PrependInt8Slot(1, outDataType, 0) 59 | 60 | def AddOutDataType(builder, outDataType): 61 | CastOptionsAddOutDataType(builder, outDataType) 62 | 63 | def CastOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return CastOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/CombinerType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class CombinerType(object): 6 | SUM = 0 7 | MEAN = 1 8 | SQRTN = 2 9 | -------------------------------------------------------------------------------- /tflite/ConcatenationOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ConcatenationOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ConcatenationOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsConcatenationOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ConcatenationOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ConcatenationOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ConcatenationOptions 32 | def Axis(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # ConcatenationOptions 39 | def FusedActivationFunction(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def ConcatenationOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | ConcatenationOptionsStart(builder) 50 | 51 | def ConcatenationOptionsAddAxis(builder, axis): 52 | builder.PrependInt32Slot(0, axis, 0) 53 | 54 | def AddAxis(builder, axis): 55 | ConcatenationOptionsAddAxis(builder, axis) 56 | 57 | def ConcatenationOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 58 | builder.PrependInt8Slot(1, fusedActivationFunction, 0) 59 | 60 | def AddFusedActivationFunction(builder, fusedActivationFunction): 61 | ConcatenationOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 62 | 63 | def ConcatenationOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return ConcatenationOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/CosOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class CosOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = CosOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsCosOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def CosOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # CosOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def CosOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | CosOptionsStart(builder) 36 | 37 | def CosOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return CosOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/CumsumOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class CumsumOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = CumsumOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsCumsumOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def CumsumOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # CumsumOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # CumsumOptions 32 | def Exclusive(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 36 | return False 37 | 38 | # CumsumOptions 39 | def Reverse(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 43 | return False 44 | 45 | def CumsumOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | CumsumOptionsStart(builder) 50 | 51 | def CumsumOptionsAddExclusive(builder, exclusive): 52 | builder.PrependBoolSlot(0, exclusive, 0) 53 | 54 | def AddExclusive(builder, exclusive): 55 | CumsumOptionsAddExclusive(builder, exclusive) 56 | 57 | def CumsumOptionsAddReverse(builder, reverse): 58 | builder.PrependBoolSlot(1, reverse, 0) 59 | 60 | def AddReverse(builder, reverse): 61 | CumsumOptionsAddReverse(builder, reverse) 62 | 63 | def CumsumOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return CumsumOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/CustomOptionsFormat.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class CustomOptionsFormat(object): 6 | FLEXBUFFERS = 0 7 | -------------------------------------------------------------------------------- /tflite/DensifyOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class DensifyOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = DensifyOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsDensifyOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def DensifyOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # DensifyOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def DensifyOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | DensifyOptionsStart(builder) 36 | 37 | def DensifyOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return DensifyOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/DepthToSpaceOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class DepthToSpaceOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = DepthToSpaceOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsDepthToSpaceOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def DepthToSpaceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # DepthToSpaceOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # DepthToSpaceOptions 32 | def BlockSize(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def DepthToSpaceOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | DepthToSpaceOptionsStart(builder) 43 | 44 | def DepthToSpaceOptionsAddBlockSize(builder, blockSize): 45 | builder.PrependInt32Slot(0, blockSize, 0) 46 | 47 | def AddBlockSize(builder, blockSize): 48 | DepthToSpaceOptionsAddBlockSize(builder, blockSize) 49 | 50 | def DepthToSpaceOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return DepthToSpaceOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/DequantizeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class DequantizeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = DequantizeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsDequantizeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def DequantizeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # DequantizeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def DequantizeOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | DequantizeOptionsStart(builder) 36 | 37 | def DequantizeOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return DequantizeOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/DilateOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class DilateOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = DilateOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsDilateOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def DilateOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # DilateOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def DilateOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | DilateOptionsStart(builder) 36 | 37 | def DilateOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return DilateOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/DimensionType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class DimensionType(object): 6 | DENSE = 0 7 | SPARSE_CSR = 1 8 | -------------------------------------------------------------------------------- /tflite/DivOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class DivOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = DivOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsDivOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def DivOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # DivOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # DivOptions 32 | def FusedActivationFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def DivOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | DivOptionsStart(builder) 43 | 44 | def DivOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 45 | builder.PrependInt8Slot(0, fusedActivationFunction, 0) 46 | 47 | def AddFusedActivationFunction(builder, fusedActivationFunction): 48 | DivOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 49 | 50 | def DivOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return DivOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/DynamicUpdateSliceOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class DynamicUpdateSliceOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = DynamicUpdateSliceOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsDynamicUpdateSliceOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def DynamicUpdateSliceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # DynamicUpdateSliceOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def DynamicUpdateSliceOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | DynamicUpdateSliceOptionsStart(builder) 36 | 37 | def DynamicUpdateSliceOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return DynamicUpdateSliceOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/EmbeddingLookupSparseOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class EmbeddingLookupSparseOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = EmbeddingLookupSparseOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsEmbeddingLookupSparseOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def EmbeddingLookupSparseOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # EmbeddingLookupSparseOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # EmbeddingLookupSparseOptions 32 | def Combiner(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def EmbeddingLookupSparseOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | EmbeddingLookupSparseOptionsStart(builder) 43 | 44 | def EmbeddingLookupSparseOptionsAddCombiner(builder, combiner): 45 | builder.PrependInt8Slot(0, combiner, 0) 46 | 47 | def AddCombiner(builder, combiner): 48 | EmbeddingLookupSparseOptionsAddCombiner(builder, combiner) 49 | 50 | def EmbeddingLookupSparseOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return EmbeddingLookupSparseOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/EqualOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class EqualOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = EqualOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsEqualOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def EqualOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # EqualOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def EqualOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | EqualOptionsStart(builder) 36 | 37 | def EqualOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return EqualOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/ExpOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ExpOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ExpOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsExpOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ExpOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ExpOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ExpOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ExpOptionsStart(builder) 36 | 37 | def ExpOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ExpOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/ExpandDimsOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ExpandDimsOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ExpandDimsOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsExpandDimsOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ExpandDimsOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ExpandDimsOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ExpandDimsOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ExpandDimsOptionsStart(builder) 36 | 37 | def ExpandDimsOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ExpandDimsOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/FillOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class FillOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = FillOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsFillOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def FillOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # FillOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def FillOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | FillOptionsStart(builder) 36 | 37 | def FillOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return FillOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/FloorDivOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class FloorDivOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = FloorDivOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsFloorDivOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def FloorDivOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # FloorDivOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def FloorDivOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | FloorDivOptionsStart(builder) 36 | 37 | def FloorDivOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return FloorDivOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/FloorModOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class FloorModOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = FloorModOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsFloorModOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def FloorModOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # FloorModOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def FloorModOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | FloorModOptionsStart(builder) 36 | 37 | def FloorModOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return FloorModOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/FullyConnectedOptionsWeightsFormat.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class FullyConnectedOptionsWeightsFormat(object): 6 | DEFAULT = 0 7 | SHUFFLED4x16INT8 = 1 8 | -------------------------------------------------------------------------------- /tflite/GatherNdOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class GatherNdOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = GatherNdOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsGatherNdOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def GatherNdOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # GatherNdOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def GatherNdOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | GatherNdOptionsStart(builder) 36 | 37 | def GatherNdOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return GatherNdOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/GatherOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class GatherOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = GatherOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsGatherOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def GatherOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # GatherOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # GatherOptions 32 | def Axis(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # GatherOptions 39 | def BatchDims(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def GatherOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | GatherOptionsStart(builder) 50 | 51 | def GatherOptionsAddAxis(builder, axis): 52 | builder.PrependInt32Slot(0, axis, 0) 53 | 54 | def AddAxis(builder, axis): 55 | GatherOptionsAddAxis(builder, axis) 56 | 57 | def GatherOptionsAddBatchDims(builder, batchDims): 58 | builder.PrependInt32Slot(1, batchDims, 0) 59 | 60 | def AddBatchDims(builder, batchDims): 61 | GatherOptionsAddBatchDims(builder, batchDims) 62 | 63 | def GatherOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return GatherOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/GeluOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class GeluOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = GeluOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsGeluOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def GeluOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # GeluOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # GeluOptions 32 | def Approximate(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 36 | return False 37 | 38 | def GeluOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | GeluOptionsStart(builder) 43 | 44 | def GeluOptionsAddApproximate(builder, approximate): 45 | builder.PrependBoolSlot(0, approximate, 0) 46 | 47 | def AddApproximate(builder, approximate): 48 | GeluOptionsAddApproximate(builder, approximate) 49 | 50 | def GeluOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return GeluOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/GreaterEqualOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class GreaterEqualOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = GreaterEqualOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsGreaterEqualOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def GreaterEqualOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # GreaterEqualOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def GreaterEqualOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | GreaterEqualOptionsStart(builder) 36 | 37 | def GreaterEqualOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return GreaterEqualOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/GreaterOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class GreaterOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = GreaterOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsGreaterOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def GreaterOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # GreaterOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def GreaterOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | GreaterOptionsStart(builder) 36 | 37 | def GreaterOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return GreaterOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/HardSwishOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class HardSwishOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = HardSwishOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsHardSwishOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def HardSwishOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # HardSwishOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def HardSwishOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | HardSwishOptionsStart(builder) 36 | 37 | def HardSwishOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return HardSwishOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/HashtableFindOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class HashtableFindOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = HashtableFindOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsHashtableFindOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def HashtableFindOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # HashtableFindOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def HashtableFindOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | HashtableFindOptionsStart(builder) 36 | 37 | def HashtableFindOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return HashtableFindOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/HashtableImportOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class HashtableImportOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = HashtableImportOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsHashtableImportOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def HashtableImportOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # HashtableImportOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def HashtableImportOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | HashtableImportOptionsStart(builder) 36 | 37 | def HashtableImportOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return HashtableImportOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/HashtableSizeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class HashtableSizeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = HashtableSizeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsHashtableSizeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def HashtableSizeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # HashtableSizeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def HashtableSizeOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | HashtableSizeOptionsStart(builder) 36 | 37 | def HashtableSizeOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return HashtableSizeOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/IfOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class IfOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = IfOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsIfOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def IfOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # IfOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # IfOptions 32 | def ThenSubgraphIndex(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # IfOptions 39 | def ElseSubgraphIndex(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def IfOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | IfOptionsStart(builder) 50 | 51 | def IfOptionsAddThenSubgraphIndex(builder, thenSubgraphIndex): 52 | builder.PrependInt32Slot(0, thenSubgraphIndex, 0) 53 | 54 | def AddThenSubgraphIndex(builder, thenSubgraphIndex): 55 | IfOptionsAddThenSubgraphIndex(builder, thenSubgraphIndex) 56 | 57 | def IfOptionsAddElseSubgraphIndex(builder, elseSubgraphIndex): 58 | builder.PrependInt32Slot(1, elseSubgraphIndex, 0) 59 | 60 | def AddElseSubgraphIndex(builder, elseSubgraphIndex): 61 | IfOptionsAddElseSubgraphIndex(builder, elseSubgraphIndex) 62 | 63 | def IfOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return IfOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/L2NormOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class L2NormOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = L2NormOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsL2NormOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def L2NormOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # L2NormOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # L2NormOptions 32 | def FusedActivationFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def L2NormOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | L2NormOptionsStart(builder) 43 | 44 | def L2NormOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 45 | builder.PrependInt8Slot(0, fusedActivationFunction, 0) 46 | 47 | def AddFusedActivationFunction(builder, fusedActivationFunction): 48 | L2NormOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 49 | 50 | def L2NormOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return L2NormOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/LSHProjectionOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LSHProjectionOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LSHProjectionOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLSHProjectionOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LSHProjectionOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LSHProjectionOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # LSHProjectionOptions 32 | def Type(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def LSHProjectionOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | LSHProjectionOptionsStart(builder) 43 | 44 | def LSHProjectionOptionsAddType(builder, type): 45 | builder.PrependInt8Slot(0, type, 0) 46 | 47 | def AddType(builder, type): 48 | LSHProjectionOptionsAddType(builder, type) 49 | 50 | def LSHProjectionOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return LSHProjectionOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/LSHProjectionType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class LSHProjectionType(object): 6 | UNKNOWN = 0 7 | SPARSE = 1 8 | DENSE = 2 9 | -------------------------------------------------------------------------------- /tflite/LSTMKernelType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class LSTMKernelType(object): 6 | FULL = 0 7 | BASIC = 1 8 | -------------------------------------------------------------------------------- /tflite/LeakyReluOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LeakyReluOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LeakyReluOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLeakyReluOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LeakyReluOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LeakyReluOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # LeakyReluOptions 32 | def Alpha(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) 36 | return 0.0 37 | 38 | def LeakyReluOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | LeakyReluOptionsStart(builder) 43 | 44 | def LeakyReluOptionsAddAlpha(builder, alpha): 45 | builder.PrependFloat32Slot(0, alpha, 0.0) 46 | 47 | def AddAlpha(builder, alpha): 48 | LeakyReluOptionsAddAlpha(builder, alpha) 49 | 50 | def LeakyReluOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return LeakyReluOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/LessEqualOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LessEqualOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LessEqualOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLessEqualOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LessEqualOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LessEqualOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def LessEqualOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | LessEqualOptionsStart(builder) 36 | 37 | def LessEqualOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return LessEqualOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/LessOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LessOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LessOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLessOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LessOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LessOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def LessOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | LessOptionsStart(builder) 36 | 37 | def LessOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return LessOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/LogSoftmaxOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LogSoftmaxOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LogSoftmaxOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLogSoftmaxOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LogSoftmaxOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LogSoftmaxOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def LogSoftmaxOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | LogSoftmaxOptionsStart(builder) 36 | 37 | def LogSoftmaxOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return LogSoftmaxOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/LogicalAndOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LogicalAndOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LogicalAndOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLogicalAndOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LogicalAndOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LogicalAndOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def LogicalAndOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | LogicalAndOptionsStart(builder) 36 | 37 | def LogicalAndOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return LogicalAndOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/LogicalNotOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LogicalNotOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LogicalNotOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLogicalNotOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LogicalNotOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LogicalNotOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def LogicalNotOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | LogicalNotOptionsStart(builder) 36 | 37 | def LogicalNotOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return LogicalNotOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/LogicalOrOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class LogicalOrOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = LogicalOrOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsLogicalOrOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def LogicalOrOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # LogicalOrOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def LogicalOrOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | LogicalOrOptionsStart(builder) 36 | 37 | def LogicalOrOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return LogicalOrOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/MatrixDiagOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class MatrixDiagOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = MatrixDiagOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsMatrixDiagOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def MatrixDiagOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # MatrixDiagOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def MatrixDiagOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | MatrixDiagOptionsStart(builder) 36 | 37 | def MatrixDiagOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return MatrixDiagOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/MatrixSetDiagOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class MatrixSetDiagOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = MatrixSetDiagOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsMatrixSetDiagOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def MatrixSetDiagOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # MatrixSetDiagOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def MatrixSetDiagOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | MatrixSetDiagOptionsStart(builder) 36 | 37 | def MatrixSetDiagOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return MatrixSetDiagOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/MaximumMinimumOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class MaximumMinimumOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = MaximumMinimumOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsMaximumMinimumOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def MaximumMinimumOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # MaximumMinimumOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def MaximumMinimumOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | MaximumMinimumOptionsStart(builder) 36 | 37 | def MaximumMinimumOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return MaximumMinimumOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/Metadata.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class Metadata(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = Metadata() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsMetadata(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def MetadataBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # Metadata 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # Metadata 32 | def Name(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.String(o + self._tab.Pos) 36 | return None 37 | 38 | # Metadata 39 | def Buffer(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def MetadataStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | MetadataStart(builder) 50 | 51 | def MetadataAddName(builder, name): 52 | builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) 53 | 54 | def AddName(builder, name): 55 | MetadataAddName(builder, name) 56 | 57 | def MetadataAddBuffer(builder, buffer): 58 | builder.PrependUint32Slot(1, buffer, 0) 59 | 60 | def AddBuffer(builder, buffer): 61 | MetadataAddBuffer(builder, buffer) 62 | 63 | def MetadataEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return MetadataEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/MirrorPadMode.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class MirrorPadMode(object): 6 | REFLECT = 0 7 | SYMMETRIC = 1 8 | -------------------------------------------------------------------------------- /tflite/MirrorPadOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class MirrorPadOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = MirrorPadOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsMirrorPadOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def MirrorPadOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # MirrorPadOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # MirrorPadOptions 32 | def Mode(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def MirrorPadOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | MirrorPadOptionsStart(builder) 43 | 44 | def MirrorPadOptionsAddMode(builder, mode): 45 | builder.PrependInt8Slot(0, mode, 0) 46 | 47 | def AddMode(builder, mode): 48 | MirrorPadOptionsAddMode(builder, mode) 49 | 50 | def MirrorPadOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return MirrorPadOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/MulOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class MulOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = MulOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsMulOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def MulOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # MulOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # MulOptions 32 | def FusedActivationFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def MulOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | MulOptionsStart(builder) 43 | 44 | def MulOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 45 | builder.PrependInt8Slot(0, fusedActivationFunction, 0) 46 | 47 | def AddFusedActivationFunction(builder, fusedActivationFunction): 48 | MulOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 49 | 50 | def MulOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return MulOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/NegOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class NegOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = NegOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsNegOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def NegOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # NegOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def NegOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | NegOptionsStart(builder) 36 | 37 | def NegOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return NegOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/NonMaxSuppressionV4Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class NonMaxSuppressionV4Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = NonMaxSuppressionV4Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsNonMaxSuppressionV4Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def NonMaxSuppressionV4OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # NonMaxSuppressionV4Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def NonMaxSuppressionV4OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | NonMaxSuppressionV4OptionsStart(builder) 36 | 37 | def NonMaxSuppressionV4OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return NonMaxSuppressionV4OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/NonMaxSuppressionV5Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class NonMaxSuppressionV5Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = NonMaxSuppressionV5Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsNonMaxSuppressionV5Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def NonMaxSuppressionV5OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # NonMaxSuppressionV5Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def NonMaxSuppressionV5OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | NonMaxSuppressionV5OptionsStart(builder) 36 | 37 | def NonMaxSuppressionV5OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return NonMaxSuppressionV5OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/NotEqualOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class NotEqualOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = NotEqualOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsNotEqualOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def NotEqualOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # NotEqualOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def NotEqualOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | NotEqualOptionsStart(builder) 36 | 37 | def NotEqualOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return NotEqualOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/OneHotOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class OneHotOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = OneHotOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsOneHotOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def OneHotOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # OneHotOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # OneHotOptions 32 | def Axis(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def OneHotOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | OneHotOptionsStart(builder) 43 | 44 | def OneHotOptionsAddAxis(builder, axis): 45 | builder.PrependInt32Slot(0, axis, 0) 46 | 47 | def AddAxis(builder, axis): 48 | OneHotOptionsAddAxis(builder, axis) 49 | 50 | def OneHotOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return OneHotOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/PackOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class PackOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = PackOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsPackOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def PackOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # PackOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # PackOptions 32 | def ValuesCount(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # PackOptions 39 | def Axis(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def PackOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | PackOptionsStart(builder) 50 | 51 | def PackOptionsAddValuesCount(builder, valuesCount): 52 | builder.PrependInt32Slot(0, valuesCount, 0) 53 | 54 | def AddValuesCount(builder, valuesCount): 55 | PackOptionsAddValuesCount(builder, valuesCount) 56 | 57 | def PackOptionsAddAxis(builder, axis): 58 | builder.PrependInt32Slot(1, axis, 0) 59 | 60 | def AddAxis(builder, axis): 61 | PackOptionsAddAxis(builder, axis) 62 | 63 | def PackOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return PackOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/PadOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class PadOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = PadOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsPadOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def PadOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # PadOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def PadOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | PadOptionsStart(builder) 36 | 37 | def PadOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return PadOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/PadV2Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class PadV2Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = PadV2Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsPadV2Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def PadV2OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # PadV2Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def PadV2OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | PadV2OptionsStart(builder) 36 | 37 | def PadV2OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return PadV2OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/Padding.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class Padding(object): 6 | SAME = 0 7 | VALID = 1 8 | -------------------------------------------------------------------------------- /tflite/PowOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class PowOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = PowOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsPowOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def PowOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # PowOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def PowOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | PowOptionsStart(builder) 36 | 37 | def PowOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return PowOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/QuantizationDetails.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class QuantizationDetails(object): 6 | NONE = 0 7 | CustomQuantization = 1 8 | -------------------------------------------------------------------------------- /tflite/QuantizeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class QuantizeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = QuantizeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsQuantizeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def QuantizeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # QuantizeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def QuantizeOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | QuantizeOptionsStart(builder) 36 | 37 | def QuantizeOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return QuantizeOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/RNNOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class RNNOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = RNNOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsRNNOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def RNNOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # RNNOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # RNNOptions 32 | def FusedActivationFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # RNNOptions 39 | def AsymmetricQuantizeInputs(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 43 | return False 44 | 45 | def RNNOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | RNNOptionsStart(builder) 50 | 51 | def RNNOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 52 | builder.PrependInt8Slot(0, fusedActivationFunction, 0) 53 | 54 | def AddFusedActivationFunction(builder, fusedActivationFunction): 55 | RNNOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 56 | 57 | def RNNOptionsAddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs): 58 | builder.PrependBoolSlot(1, asymmetricQuantizeInputs, 0) 59 | 60 | def AddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs): 61 | RNNOptionsAddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs) 62 | 63 | def RNNOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return RNNOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/RandomOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class RandomOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = RandomOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsRandomOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def RandomOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # RandomOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # RandomOptions 32 | def Seed(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # RandomOptions 39 | def Seed2(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def RandomOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | RandomOptionsStart(builder) 50 | 51 | def RandomOptionsAddSeed(builder, seed): 52 | builder.PrependInt64Slot(0, seed, 0) 53 | 54 | def AddSeed(builder, seed): 55 | RandomOptionsAddSeed(builder, seed) 56 | 57 | def RandomOptionsAddSeed2(builder, seed2): 58 | builder.PrependInt64Slot(1, seed2, 0) 59 | 60 | def AddSeed2(builder, seed2): 61 | RandomOptionsAddSeed2(builder, seed2) 62 | 63 | def RandomOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return RandomOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/RangeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class RangeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = RangeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsRangeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def RangeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # RangeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def RangeOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | RangeOptionsStart(builder) 36 | 37 | def RangeOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return RangeOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/RankOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class RankOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = RankOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsRankOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def RankOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # RankOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def RankOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | RankOptionsStart(builder) 36 | 37 | def RankOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return RankOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/ReadVariableOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ReadVariableOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ReadVariableOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsReadVariableOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ReadVariableOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ReadVariableOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ReadVariableOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ReadVariableOptionsStart(builder) 36 | 37 | def ReadVariableOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ReadVariableOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/ReduceWindowFunction.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class ReduceWindowFunction(object): 6 | UNSUPPORTED = 0 7 | ADD = 1 8 | MUL = 2 9 | MINIMUM = 3 10 | MAXIMUM = 4 11 | ALL = 5 12 | ANY = 6 13 | -------------------------------------------------------------------------------- /tflite/ReduceWindowOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ReduceWindowOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ReduceWindowOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsReduceWindowOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ReduceWindowOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ReduceWindowOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ReduceWindowOptions 32 | def ReduceFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def ReduceWindowOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | ReduceWindowOptionsStart(builder) 43 | 44 | def ReduceWindowOptionsAddReduceFunction(builder, reduceFunction): 45 | builder.PrependInt32Slot(0, reduceFunction, 0) 46 | 47 | def AddReduceFunction(builder, reduceFunction): 48 | ReduceWindowOptionsAddReduceFunction(builder, reduceFunction) 49 | 50 | def ReduceWindowOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return ReduceWindowOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/ReducerOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ReducerOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ReducerOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsReducerOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ReducerOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ReducerOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ReducerOptions 32 | def KeepDims(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 36 | return False 37 | 38 | def ReducerOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | ReducerOptionsStart(builder) 43 | 44 | def ReducerOptionsAddKeepDims(builder, keepDims): 45 | builder.PrependBoolSlot(0, keepDims, 0) 46 | 47 | def AddKeepDims(builder, keepDims): 48 | ReducerOptionsAddKeepDims(builder, keepDims) 49 | 50 | def ReducerOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return ReducerOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/ResizeBilinearOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ResizeBilinearOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ResizeBilinearOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsResizeBilinearOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ResizeBilinearOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ResizeBilinearOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ResizeBilinearOptions 32 | def AlignCorners(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) 34 | if o != 0: 35 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 36 | return False 37 | 38 | # ResizeBilinearOptions 39 | def HalfPixelCenters(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) 41 | if o != 0: 42 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 43 | return False 44 | 45 | def ResizeBilinearOptionsStart(builder): 46 | builder.StartObject(4) 47 | 48 | def Start(builder): 49 | ResizeBilinearOptionsStart(builder) 50 | 51 | def ResizeBilinearOptionsAddAlignCorners(builder, alignCorners): 52 | builder.PrependBoolSlot(2, alignCorners, 0) 53 | 54 | def AddAlignCorners(builder, alignCorners): 55 | ResizeBilinearOptionsAddAlignCorners(builder, alignCorners) 56 | 57 | def ResizeBilinearOptionsAddHalfPixelCenters(builder, halfPixelCenters): 58 | builder.PrependBoolSlot(3, halfPixelCenters, 0) 59 | 60 | def AddHalfPixelCenters(builder, halfPixelCenters): 61 | ResizeBilinearOptionsAddHalfPixelCenters(builder, halfPixelCenters) 62 | 63 | def ResizeBilinearOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return ResizeBilinearOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/ResizeNearestNeighborOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ResizeNearestNeighborOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ResizeNearestNeighborOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsResizeNearestNeighborOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ResizeNearestNeighborOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ResizeNearestNeighborOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ResizeNearestNeighborOptions 32 | def AlignCorners(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 36 | return False 37 | 38 | # ResizeNearestNeighborOptions 39 | def HalfPixelCenters(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 43 | return False 44 | 45 | def ResizeNearestNeighborOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | ResizeNearestNeighborOptionsStart(builder) 50 | 51 | def ResizeNearestNeighborOptionsAddAlignCorners(builder, alignCorners): 52 | builder.PrependBoolSlot(0, alignCorners, 0) 53 | 54 | def AddAlignCorners(builder, alignCorners): 55 | ResizeNearestNeighborOptionsAddAlignCorners(builder, alignCorners) 56 | 57 | def ResizeNearestNeighborOptionsAddHalfPixelCenters(builder, halfPixelCenters): 58 | builder.PrependBoolSlot(1, halfPixelCenters, 0) 59 | 60 | def AddHalfPixelCenters(builder, halfPixelCenters): 61 | ResizeNearestNeighborOptionsAddHalfPixelCenters(builder, halfPixelCenters) 62 | 63 | def ResizeNearestNeighborOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return ResizeNearestNeighborOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/ReverseSequenceOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ReverseSequenceOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ReverseSequenceOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsReverseSequenceOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ReverseSequenceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ReverseSequenceOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ReverseSequenceOptions 32 | def SeqDim(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # ReverseSequenceOptions 39 | def BatchDim(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def ReverseSequenceOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | ReverseSequenceOptionsStart(builder) 50 | 51 | def ReverseSequenceOptionsAddSeqDim(builder, seqDim): 52 | builder.PrependInt32Slot(0, seqDim, 0) 53 | 54 | def AddSeqDim(builder, seqDim): 55 | ReverseSequenceOptionsAddSeqDim(builder, seqDim) 56 | 57 | def ReverseSequenceOptionsAddBatchDim(builder, batchDim): 58 | builder.PrependInt32Slot(1, batchDim, 0) 59 | 60 | def AddBatchDim(builder, batchDim): 61 | ReverseSequenceOptionsAddBatchDim(builder, batchDim) 62 | 63 | def ReverseSequenceOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return ReverseSequenceOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/ReverseV2Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ReverseV2Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ReverseV2Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsReverseV2Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ReverseV2OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ReverseV2Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ReverseV2OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ReverseV2OptionsStart(builder) 36 | 37 | def ReverseV2OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ReverseV2OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/Rfft2dOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class Rfft2dOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = Rfft2dOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsRfft2dOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def Rfft2dOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # Rfft2dOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def Rfft2dOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | Rfft2dOptionsStart(builder) 36 | 37 | def Rfft2dOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return Rfft2dOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/RightShiftOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class RightShiftOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = RightShiftOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsRightShiftOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def RightShiftOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # RightShiftOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def RightShiftOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | RightShiftOptionsStart(builder) 36 | 37 | def RightShiftOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return RightShiftOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/RngAlgorithm.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class RngAlgorithm(object): 6 | DEFAULT = 0 7 | PHILOX = 1 8 | THREEFRY = 2 9 | -------------------------------------------------------------------------------- /tflite/ScatterNdOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ScatterNdOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ScatterNdOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsScatterNdOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ScatterNdOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ScatterNdOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ScatterNdOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ScatterNdOptionsStart(builder) 36 | 37 | def ScatterNdOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ScatterNdOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SegmentSumOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SegmentSumOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SegmentSumOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSegmentSumOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SegmentSumOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SegmentSumOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SegmentSumOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SegmentSumOptionsStart(builder) 36 | 37 | def SegmentSumOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SegmentSumOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SelectOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SelectOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SelectOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSelectOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SelectOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SelectOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SelectOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SelectOptionsStart(builder) 36 | 37 | def SelectOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SelectOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SelectV2Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SelectV2Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SelectV2Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSelectV2Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SelectV2OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SelectV2Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SelectV2OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SelectV2OptionsStart(builder) 36 | 37 | def SelectV2OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SelectV2OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/ShapeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ShapeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ShapeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsShapeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ShapeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ShapeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # ShapeOptions 32 | def OutType(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def ShapeOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | ShapeOptionsStart(builder) 43 | 44 | def ShapeOptionsAddOutType(builder, outType): 45 | builder.PrependInt8Slot(0, outType, 0) 46 | 47 | def AddOutType(builder, outType): 48 | ShapeOptionsAddOutType(builder, outType) 49 | 50 | def ShapeOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return ShapeOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/SignOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SignOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SignOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSignOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SignOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SignOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SignOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SignOptionsStart(builder) 36 | 37 | def SignOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SignOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SliceOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SliceOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SliceOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSliceOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SliceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SliceOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SliceOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SliceOptionsStart(builder) 36 | 37 | def SliceOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SliceOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SoftmaxOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SoftmaxOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SoftmaxOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSoftmaxOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SoftmaxOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SoftmaxOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # SoftmaxOptions 32 | def Beta(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) 36 | return 0.0 37 | 38 | def SoftmaxOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | SoftmaxOptionsStart(builder) 43 | 44 | def SoftmaxOptionsAddBeta(builder, beta): 45 | builder.PrependFloat32Slot(0, beta, 0.0) 46 | 47 | def AddBeta(builder, beta): 48 | SoftmaxOptionsAddBeta(builder, beta) 49 | 50 | def SoftmaxOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return SoftmaxOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/SpaceToBatchNDOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SpaceToBatchNDOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SpaceToBatchNDOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSpaceToBatchNDOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SpaceToBatchNDOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SpaceToBatchNDOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SpaceToBatchNDOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SpaceToBatchNDOptionsStart(builder) 36 | 37 | def SpaceToBatchNDOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SpaceToBatchNDOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SpaceToDepthOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SpaceToDepthOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SpaceToDepthOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSpaceToDepthOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SpaceToDepthOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SpaceToDepthOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # SpaceToDepthOptions 32 | def BlockSize(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def SpaceToDepthOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | SpaceToDepthOptionsStart(builder) 43 | 44 | def SpaceToDepthOptionsAddBlockSize(builder, blockSize): 45 | builder.PrependInt32Slot(0, blockSize, 0) 46 | 47 | def AddBlockSize(builder, blockSize): 48 | SpaceToDepthOptionsAddBlockSize(builder, blockSize) 49 | 50 | def SpaceToDepthOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return SpaceToDepthOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/SparseIndexVector.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class SparseIndexVector(object): 6 | NONE = 0 7 | Int32Vector = 1 8 | Uint16Vector = 2 9 | Uint8Vector = 3 10 | -------------------------------------------------------------------------------- /tflite/SparseToDenseOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SparseToDenseOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SparseToDenseOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSparseToDenseOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SparseToDenseOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SparseToDenseOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # SparseToDenseOptions 32 | def ValidateIndices(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 36 | return False 37 | 38 | def SparseToDenseOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | SparseToDenseOptionsStart(builder) 43 | 44 | def SparseToDenseOptionsAddValidateIndices(builder, validateIndices): 45 | builder.PrependBoolSlot(0, validateIndices, 0) 46 | 47 | def AddValidateIndices(builder, validateIndices): 48 | SparseToDenseOptionsAddValidateIndices(builder, validateIndices) 49 | 50 | def SparseToDenseOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return SparseToDenseOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/SplitOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SplitOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SplitOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSplitOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SplitOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SplitOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # SplitOptions 32 | def NumSplits(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def SplitOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | SplitOptionsStart(builder) 43 | 44 | def SplitOptionsAddNumSplits(builder, numSplits): 45 | builder.PrependInt32Slot(0, numSplits, 0) 46 | 47 | def AddNumSplits(builder, numSplits): 48 | SplitOptionsAddNumSplits(builder, numSplits) 49 | 50 | def SplitOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return SplitOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/SplitVOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SplitVOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SplitVOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSplitVOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SplitVOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SplitVOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # SplitVOptions 32 | def NumSplits(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def SplitVOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | SplitVOptionsStart(builder) 43 | 44 | def SplitVOptionsAddNumSplits(builder, numSplits): 45 | builder.PrependInt32Slot(0, numSplits, 0) 46 | 47 | def AddNumSplits(builder, numSplits): 48 | SplitVOptionsAddNumSplits(builder, numSplits) 49 | 50 | def SplitVOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return SplitVOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/SquareOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SquareOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SquareOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSquareOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SquareOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SquareOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SquareOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SquareOptionsStart(builder) 36 | 37 | def SquareOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SquareOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/SquaredDifferenceOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SquaredDifferenceOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SquaredDifferenceOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSquaredDifferenceOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SquaredDifferenceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SquaredDifferenceOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def SquaredDifferenceOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | SquaredDifferenceOptionsStart(builder) 36 | 37 | def SquaredDifferenceOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return SquaredDifferenceOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/StablehloCompareOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class StablehloCompareOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = StablehloCompareOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsStablehloCompareOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def StablehloCompareOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # StablehloCompareOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # StablehloCompareOptions 32 | def ComparisonDirection(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # StablehloCompareOptions 39 | def CompareType(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def StablehloCompareOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | StablehloCompareOptionsStart(builder) 50 | 51 | def StablehloCompareOptionsAddComparisonDirection(builder, comparisonDirection): 52 | builder.PrependUint32Slot(0, comparisonDirection, 0) 53 | 54 | def AddComparisonDirection(builder, comparisonDirection): 55 | StablehloCompareOptionsAddComparisonDirection(builder, comparisonDirection) 56 | 57 | def StablehloCompareOptionsAddCompareType(builder, compareType): 58 | builder.PrependUint32Slot(1, compareType, 0) 59 | 60 | def AddCompareType(builder, compareType): 61 | StablehloCompareOptionsAddCompareType(builder, compareType) 62 | 63 | def StablehloCompareOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return StablehloCompareOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/StablehloComparisonDirection.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class StablehloComparisonDirection(object): 6 | STABLEHLO_COMPARISON_DIRECTION_EQ = 0 7 | STABLEHLO_COMPARISON_DIRECTION_NE = 1 8 | STABLEHLO_COMPARISON_DIRECTION_GE = 2 9 | STABLEHLO_COMPARISON_DIRECTION_GT = 3 10 | STABLEHLO_COMPARISON_DIRECTION_LE = 4 11 | STABLEHLO_COMPARISON_DIRECTION_LT = 5 12 | -------------------------------------------------------------------------------- /tflite/StablehloComparisonType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class StablehloComparisonType(object): 6 | STABLEHLO_COMPARISON_TYPE_NOTYPE = 0 7 | STABLEHLO_COMPARISON_TYPE_FLOAT = 1 8 | STABLEHLO_COMPARISON_TYPE_FLOAT_TOTAL_ORDER = 2 9 | STABLEHLO_COMPARISON_TYPE_SIGNED = 3 10 | STABLEHLO_COMPARISON_TYPE_UNSIGNED = 4 11 | -------------------------------------------------------------------------------- /tflite/StablehloConcatenateOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class StablehloConcatenateOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = StablehloConcatenateOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsStablehloConcatenateOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def StablehloConcatenateOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # StablehloConcatenateOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # StablehloConcatenateOptions 32 | def Dimension(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def StablehloConcatenateOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | StablehloConcatenateOptionsStart(builder) 43 | 44 | def StablehloConcatenateOptionsAddDimension(builder, dimension): 45 | builder.PrependInt64Slot(0, dimension, 0) 46 | 47 | def AddDimension(builder, dimension): 48 | StablehloConcatenateOptionsAddDimension(builder, dimension) 49 | 50 | def StablehloConcatenateOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return StablehloConcatenateOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/StablehloIotaOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class StablehloIotaOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = StablehloIotaOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsStablehloIotaOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def StablehloIotaOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # StablehloIotaOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # StablehloIotaOptions 32 | def IotaDimension(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def StablehloIotaOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | StablehloIotaOptionsStart(builder) 43 | 44 | def StablehloIotaOptionsAddIotaDimension(builder, iotaDimension): 45 | builder.PrependInt64Slot(0, iotaDimension, 0) 46 | 47 | def AddIotaDimension(builder, iotaDimension): 48 | StablehloIotaOptionsAddIotaDimension(builder, iotaDimension) 49 | 50 | def StablehloIotaOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return StablehloIotaOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/StablehloPrecisionConfig.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class StablehloPrecisionConfig(object): 6 | DEFAULT = 0 7 | HIGH = 1 8 | HIGHEST = 2 9 | -------------------------------------------------------------------------------- /tflite/StablehloRngBitGeneratorOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class StablehloRngBitGeneratorOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = StablehloRngBitGeneratorOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsStablehloRngBitGeneratorOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def StablehloRngBitGeneratorOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # StablehloRngBitGeneratorOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # StablehloRngBitGeneratorOptions 32 | def Algorithm(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | def StablehloRngBitGeneratorOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | StablehloRngBitGeneratorOptionsStart(builder) 43 | 44 | def StablehloRngBitGeneratorOptionsAddAlgorithm(builder, algorithm): 45 | builder.PrependInt8Slot(0, algorithm, 0) 46 | 47 | def AddAlgorithm(builder, algorithm): 48 | StablehloRngBitGeneratorOptionsAddAlgorithm(builder, algorithm) 49 | 50 | def StablehloRngBitGeneratorOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return StablehloRngBitGeneratorOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/StablehloShiftLeftOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class StablehloShiftLeftOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = StablehloShiftLeftOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsStablehloShiftLeftOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def StablehloShiftLeftOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # StablehloShiftLeftOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def StablehloShiftLeftOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | StablehloShiftLeftOptionsStart(builder) 36 | 37 | def StablehloShiftLeftOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return StablehloShiftLeftOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/StablehloWhileOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class StablehloWhileOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = StablehloWhileOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsStablehloWhileOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def StablehloWhileOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # StablehloWhileOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # StablehloWhileOptions 32 | def CondSubgraphIndex(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # StablehloWhileOptions 39 | def BodySubgraphIndex(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def StablehloWhileOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | StablehloWhileOptionsStart(builder) 50 | 51 | def StablehloWhileOptionsAddCondSubgraphIndex(builder, condSubgraphIndex): 52 | builder.PrependInt32Slot(0, condSubgraphIndex, 0) 53 | 54 | def AddCondSubgraphIndex(builder, condSubgraphIndex): 55 | StablehloWhileOptionsAddCondSubgraphIndex(builder, condSubgraphIndex) 56 | 57 | def StablehloWhileOptionsAddBodySubgraphIndex(builder, bodySubgraphIndex): 58 | builder.PrependInt32Slot(1, bodySubgraphIndex, 0) 59 | 60 | def AddBodySubgraphIndex(builder, bodySubgraphIndex): 61 | StablehloWhileOptionsAddBodySubgraphIndex(builder, bodySubgraphIndex) 62 | 63 | def StablehloWhileOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return StablehloWhileOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/SubOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class SubOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = SubOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsSubOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def SubOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # SubOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # SubOptions 32 | def FusedActivationFunction(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # SubOptions 39 | def PotScaleInt16(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) 43 | return True 44 | 45 | def SubOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | SubOptionsStart(builder) 50 | 51 | def SubOptionsAddFusedActivationFunction(builder, fusedActivationFunction): 52 | builder.PrependInt8Slot(0, fusedActivationFunction, 0) 53 | 54 | def AddFusedActivationFunction(builder, fusedActivationFunction): 55 | SubOptionsAddFusedActivationFunction(builder, fusedActivationFunction) 56 | 57 | def SubOptionsAddPotScaleInt16(builder, potScaleInt16): 58 | builder.PrependBoolSlot(1, potScaleInt16, 1) 59 | 60 | def AddPotScaleInt16(builder, potScaleInt16): 61 | SubOptionsAddPotScaleInt16(builder, potScaleInt16) 62 | 63 | def SubOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return SubOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/TensorMap.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class TensorMap(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = TensorMap() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsTensorMap(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def TensorMapBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # TensorMap 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # TensorMap 32 | def Name(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.String(o + self._tab.Pos) 36 | return None 37 | 38 | # TensorMap 39 | def TensorIndex(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def TensorMapStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | TensorMapStart(builder) 50 | 51 | def TensorMapAddName(builder, name): 52 | builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) 53 | 54 | def AddName(builder, name): 55 | TensorMapAddName(builder, name) 56 | 57 | def TensorMapAddTensorIndex(builder, tensorIndex): 58 | builder.PrependUint32Slot(1, tensorIndex, 0) 59 | 60 | def AddTensorIndex(builder, tensorIndex): 61 | TensorMapAddTensorIndex(builder, tensorIndex) 62 | 63 | def TensorMapEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return TensorMapEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/TensorType.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | class TensorType(object): 6 | FLOAT32 = 0 7 | FLOAT16 = 1 8 | INT32 = 2 9 | UINT8 = 3 10 | INT64 = 4 11 | STRING = 5 12 | BOOL = 6 13 | INT16 = 7 14 | COMPLEX64 = 8 15 | INT8 = 9 16 | FLOAT64 = 10 17 | COMPLEX128 = 11 18 | UINT64 = 12 19 | RESOURCE = 13 20 | VARIANT = 14 21 | UINT32 = 15 22 | UINT16 = 16 23 | INT4 = 17 24 | BFLOAT16 = 18 25 | -------------------------------------------------------------------------------- /tflite/TileOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class TileOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = TileOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsTileOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def TileOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # TileOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def TileOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | TileOptionsStart(builder) 36 | 37 | def TileOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return TileOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/TopKV2Options.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class TopKV2Options(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = TopKV2Options() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsTopKV2Options(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def TopKV2OptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # TopKV2Options 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def TopKV2OptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | TopKV2OptionsStart(builder) 36 | 37 | def TopKV2OptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return TopKV2OptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/TransposeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class TransposeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = TransposeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsTransposeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def TransposeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # TransposeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def TransposeOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | TransposeOptionsStart(builder) 36 | 37 | def TransposeOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return TransposeOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/UniqueOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class UniqueOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = UniqueOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsUniqueOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def UniqueOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # UniqueOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # UniqueOptions 32 | def IdxOutType(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 36 | return 2 37 | 38 | def UniqueOptionsStart(builder): 39 | builder.StartObject(1) 40 | 41 | def Start(builder): 42 | UniqueOptionsStart(builder) 43 | 44 | def UniqueOptionsAddIdxOutType(builder, idxOutType): 45 | builder.PrependInt8Slot(0, idxOutType, 2) 46 | 47 | def AddIdxOutType(builder, idxOutType): 48 | UniqueOptionsAddIdxOutType(builder, idxOutType) 49 | 50 | def UniqueOptionsEnd(builder): 51 | return builder.EndObject() 52 | 53 | def End(builder): 54 | return UniqueOptionsEnd(builder) 55 | -------------------------------------------------------------------------------- /tflite/UnpackOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class UnpackOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = UnpackOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsUnpackOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def UnpackOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # UnpackOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # UnpackOptions 32 | def Num(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # UnpackOptions 39 | def Axis(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def UnpackOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | UnpackOptionsStart(builder) 50 | 51 | def UnpackOptionsAddNum(builder, num): 52 | builder.PrependInt32Slot(0, num, 0) 53 | 54 | def AddNum(builder, num): 55 | UnpackOptionsAddNum(builder, num) 56 | 57 | def UnpackOptionsAddAxis(builder, axis): 58 | builder.PrependInt32Slot(1, axis, 0) 59 | 60 | def AddAxis(builder, axis): 61 | UnpackOptionsAddAxis(builder, axis) 62 | 63 | def UnpackOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return UnpackOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/UnsortedSegmentMaxOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class UnsortedSegmentMaxOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = UnsortedSegmentMaxOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsUnsortedSegmentMaxOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def UnsortedSegmentMaxOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # UnsortedSegmentMaxOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def UnsortedSegmentMaxOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | UnsortedSegmentMaxOptionsStart(builder) 36 | 37 | def UnsortedSegmentMaxOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return UnsortedSegmentMaxOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/UnsortedSegmentMinOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class UnsortedSegmentMinOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = UnsortedSegmentMinOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsUnsortedSegmentMinOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def UnsortedSegmentMinOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # UnsortedSegmentMinOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def UnsortedSegmentMinOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | UnsortedSegmentMinOptionsStart(builder) 36 | 37 | def UnsortedSegmentMinOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return UnsortedSegmentMinOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/UnsortedSegmentProdOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class UnsortedSegmentProdOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = UnsortedSegmentProdOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsUnsortedSegmentProdOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def UnsortedSegmentProdOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # UnsortedSegmentProdOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def UnsortedSegmentProdOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | UnsortedSegmentProdOptionsStart(builder) 36 | 37 | def UnsortedSegmentProdOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return UnsortedSegmentProdOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/UnsortedSegmentSumOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class UnsortedSegmentSumOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = UnsortedSegmentSumOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsUnsortedSegmentSumOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def UnsortedSegmentSumOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # UnsortedSegmentSumOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def UnsortedSegmentSumOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | UnsortedSegmentSumOptionsStart(builder) 36 | 37 | def UnsortedSegmentSumOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return UnsortedSegmentSumOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/VarHandleOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class VarHandleOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = VarHandleOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsVarHandleOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def VarHandleOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # VarHandleOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # VarHandleOptions 32 | def Container(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.String(o + self._tab.Pos) 36 | return None 37 | 38 | # VarHandleOptions 39 | def SharedName(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.String(o + self._tab.Pos) 43 | return None 44 | 45 | def VarHandleOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | VarHandleOptionsStart(builder) 50 | 51 | def VarHandleOptionsAddContainer(builder, container): 52 | builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(container), 0) 53 | 54 | def AddContainer(builder, container): 55 | VarHandleOptionsAddContainer(builder, container) 56 | 57 | def VarHandleOptionsAddSharedName(builder, sharedName): 58 | builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(sharedName), 0) 59 | 60 | def AddSharedName(builder, sharedName): 61 | VarHandleOptionsAddSharedName(builder, sharedName) 62 | 63 | def VarHandleOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return VarHandleOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/WhereOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class WhereOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = WhereOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsWhereOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def WhereOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # WhereOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def WhereOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | WhereOptionsStart(builder) 36 | 37 | def WhereOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return WhereOptionsEnd(builder) 42 | -------------------------------------------------------------------------------- /tflite/WhileOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class WhileOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = WhileOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsWhileOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def WhileOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # WhileOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | # WhileOptions 32 | def CondSubgraphIndex(self): 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 34 | if o != 0: 35 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 36 | return 0 37 | 38 | # WhileOptions 39 | def BodySubgraphIndex(self): 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) 41 | if o != 0: 42 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) 43 | return 0 44 | 45 | def WhileOptionsStart(builder): 46 | builder.StartObject(2) 47 | 48 | def Start(builder): 49 | WhileOptionsStart(builder) 50 | 51 | def WhileOptionsAddCondSubgraphIndex(builder, condSubgraphIndex): 52 | builder.PrependInt32Slot(0, condSubgraphIndex, 0) 53 | 54 | def AddCondSubgraphIndex(builder, condSubgraphIndex): 55 | WhileOptionsAddCondSubgraphIndex(builder, condSubgraphIndex) 56 | 57 | def WhileOptionsAddBodySubgraphIndex(builder, bodySubgraphIndex): 58 | builder.PrependInt32Slot(1, bodySubgraphIndex, 0) 59 | 60 | def AddBodySubgraphIndex(builder, bodySubgraphIndex): 61 | WhileOptionsAddBodySubgraphIndex(builder, bodySubgraphIndex) 62 | 63 | def WhileOptionsEnd(builder): 64 | return builder.EndObject() 65 | 66 | def End(builder): 67 | return WhileOptionsEnd(builder) 68 | -------------------------------------------------------------------------------- /tflite/ZerosLikeOptions.py: -------------------------------------------------------------------------------- 1 | # automatically generated by the FlatBuffers compiler, do not modify 2 | 3 | # namespace: tflite 4 | 5 | import flatbuffers 6 | from flatbuffers.compat import import_numpy 7 | np = import_numpy() 8 | 9 | class ZerosLikeOptions(object): 10 | __slots__ = ['_tab'] 11 | 12 | @classmethod 13 | def GetRootAs(cls, buf, offset=0): 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 15 | x = ZerosLikeOptions() 16 | x.Init(buf, n + offset) 17 | return x 18 | 19 | @classmethod 20 | def GetRootAsZerosLikeOptions(cls, buf, offset=0): 21 | """This method is deprecated. Please switch to GetRootAs.""" 22 | return cls.GetRootAs(buf, offset) 23 | @classmethod 24 | def ZerosLikeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) 26 | 27 | # ZerosLikeOptions 28 | def Init(self, buf, pos): 29 | self._tab = flatbuffers.table.Table(buf, pos) 30 | 31 | def ZerosLikeOptionsStart(builder): 32 | builder.StartObject(0) 33 | 34 | def Start(builder): 35 | ZerosLikeOptionsStart(builder) 36 | 37 | def ZerosLikeOptionsEnd(builder): 38 | return builder.EndObject() 39 | 40 | def End(builder): 41 | return ZerosLikeOptionsEnd(builder) 42 | --------------------------------------------------------------------------------