chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+79
View File
@@ -0,0 +1,79 @@
{
version: 3,
operator_codes: [
{
}
],
subgraphs: [
{
tensors: [
{
shape: [
1,
8,
8,
3
],
name: "add"
},
{
shape: [
1,
8,
8,
3
],
name: "input"
},
{
shape: [
1,
8,
8,
3
],
name: "output"
}
],
inputs: [
1
],
outputs: [
2
],
operators: [
{
inputs: [
1,
1
],
outputs: [
0
],
builtin_options_type: "AddOptions",
builtin_options: {
}
},
{
inputs: [
0,
1
],
outputs: [
2
],
builtin_options_type: "AddOptions",
builtin_options: {
}
}
]
}
],
buffers: [
{
data: [
]
}
]
}
Binary file not shown.
+123
View File
@@ -0,0 +1,123 @@
{
version: 3,
operator_codes: [
{
}
],
subgraphs: [
{
tensors: [
{
shape: [
1,
8,
8,
3
],
name: "add",
quantization: {
min: [
0.0
],
max: [
1.0
],
scale: [
0.003922
],
zero_point: [
0
]
}
},
{
shape: [
1,
8,
8,
3
],
type: "UINT8",
name: "input",
quantization: {
min: [
0.0
],
max: [
1.0
],
scale: [
0.003922
],
zero_point: [
0
]
}
},
{
shape: [
1,
8,
8,
3
],
type: "UINT8",
name: "output",
quantization: {
min: [
0.0
],
max: [
1.0
],
scale: [
0.003922
],
zero_point: [
0
]
}
}
],
inputs: [
1
],
outputs: [
2
],
operators: [
{
inputs: [
1,
1
],
outputs: [
0
],
builtin_options_type: "AddOptions",
builtin_options: {
}
},
{
inputs: [
0,
1
],
outputs: [
2
],
builtin_options_type: "AddOptions",
builtin_options: {
}
}
]
}
],
buffers: [
{
data: [
]
}
]
}
Binary file not shown.
+123
View File
@@ -0,0 +1,123 @@
{
version: 3,
operator_codes: [
{
}
],
subgraphs: [
{
tensors: [
{
shape: [
1,
8,
8,
3
],
name: "add",
quantization: {
min: [
0.0
],
max: [
1.0
],
scale: [
0.003922
],
zero_point: [
0
]
}
},
{
shape: [
1,
8,
8,
3
],
type: "INT8",
name: "input",
quantization: {
min: [
0.0
],
max: [
1.0
],
scale: [
0.003922
],
zero_point: [
0
]
}
},
{
shape: [
1,
8,
8,
3
],
type: "INT8",
name: "output",
quantization: {
min: [
0.0
],
max: [
1.0
],
scale: [
0.003922
],
zero_point: [
0
]
}
}
],
inputs: [
1
],
outputs: [
2
],
operators: [
{
inputs: [
1,
1
],
outputs: [
0
],
builtin_options_type: "AddOptions",
builtin_options: {
}
},
{
inputs: [
0,
1
],
outputs: [
2
],
builtin_options_type: "AddOptions",
builtin_options: {
}
}
]
}
],
buffers: [
{
data: [
]
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+131
View File
@@ -0,0 +1,131 @@
{
"version": 3,
"operator_codes": [
{
}
],
"subgraphs": [
{
"tensors": [
{
"shape": [
1,
8,
8,
3
],
"name": "a"
},
{
"shape": [
1,
8,
8,
3
],
"name": "b"
},
{
"shape": [
1,
8,
8,
3
],
"name": "c"
},
{
"shape": [
1,
8,
8,
3
],
"name": "d"
},
{
"shape": [
1,
8,
8,
3
],
"name": "i"
},
{
"shape": [
1,
8,
8,
3
],
"name": "x"
},
{
"shape": [
1,
8,
8,
3
],
"name": "y"
}
],
"inputs": [
0,
1,
2,
3
],
"outputs": [
5,
6
],
"operators": [
{
"inputs": [
1,
2
],
"outputs": [
4
],
"builtin_options_type": "AddOptions",
"builtin_options": {
}
},
{
"inputs": [
0,
4
],
"outputs": [
5
],
"builtin_options_type": "AddOptions",
"builtin_options": {
}
},
{
"inputs": [
3,
4
],
"outputs": [
6
],
"builtin_options_type": "AddOptions",
"builtin_options": {
}
}
]
}
],
"buffers": [
{
"data": [
]
}
]
}
+26
View File
@@ -0,0 +1,26 @@
I
a Placeholder"
/device:CPU:0*
shape:*
dtype0
I
b Placeholder"
/device:CPU:0*
dtype0*
shape:
I
c Placeholder"
/device:CPU:0*
dtype0*
shape:
I
d Placeholder"
/device:CPU:0*
dtype0*
shape:
&
iAddbc"
/device:CPU:0*
T0
&
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+69
View File
@@ -0,0 +1,69 @@
{
"version": 3,
"operator_codes": [{"builtin_code": "CUSTOM", "custom_code": "FakeOp"}],
"subgraphs": [
{
"tensors": [
{
"shape": [
4,
4
],
"name": "sparse_tensor",
"buffer": 1,
"type": "INT8",
"quantization": {
},
"is_variable": "false",
"sparsity": {
"traversal_order": [0, 1, 2, 3],
"block_map": [0, 1],
"dim_metadata": [
{
"format": "DENSE",
"dense_size": 2
},
{
"format": "SPARSE_CSR",
"array_segments_type": "Uint8Vector",
"array_segments": {"values": [0, 2, 3]},
"array_indices_type": "Uint8Vector",
"array_indices": {"values": [0, 1, 1]}
},
{
"format": "DENSE",
"dense_size": 2
},
{
"format": "DENSE",
"dense_size": 2
}
]
}
},
{
"shape": [
4,
4
],
"name": "output_tensor",
"type": "INT8"
}
],
"inputs": [0],
"outputs": [0],
"operators": [{"inputs":[-1], "outputs":[1]}]
}
],
"buffers": [
{
},
{
"data": [
1, 0, 0, 4,
2, 3, 0, 0,
5, 0, 0, 6
]
}
]
}
+18
View File
@@ -0,0 +1,18 @@
load("@xla//third_party/rules_python/python:py_binary.bzl", "py_binary")
package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:LICENSE"],
default_visibility = ["//visibility:public"],
licenses = ["notice"],
)
py_binary(
name = "intermediate_tensor_output",
srcs = ["intermediate_tensor_output.py"],
python_version = "PY3",
strict_deps = True,
deps = [
"//tensorflow:tensorflow_py",
"//tensorflow/lite/python:lite",
],
)
@@ -0,0 +1,48 @@
# Copyright 2023 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""A model whose intermediate tensor is also used as a model output."""
import tensorflow as tf
from tensorflow.lite.python import lite
@tf.function(
input_signature=[
tf.TensorSpec(shape=[1, 4, 4, 4], dtype=tf.float32),
tf.TensorSpec(shape=[1, 4, 4, 4], dtype=tf.float32),
]
)
def func(a, b):
c = a + b
d = c + a
e = d + a
f = e + a
return c, f
def main():
converter = lite.TFLiteConverter.from_concrete_functions(
[func.get_concrete_function()]
)
converter.target_spec = lite.TargetSpec()
tflite_model = converter.convert()
model_path = '/tmp/intermediate_tensor_output.tflite'
with open(model_path, 'wb') as f:
f.write(tflite_model)
print(f'TFLite model {model_path} is generated.\n')
if __name__ == '__main__':
main()
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+62
View File
@@ -0,0 +1,62 @@
{
"subgraphs": [
{
"inputs": [0, 1],
"outputs": [2, 3],
"operators": [
{
"opcode_index": 0,
"inputs": [0,1],
"outputs": [2]
},
{
"opcode_index": 1,
"inputs": [2],
"outputs": [3]
}
],
"tensors": [
{
"shape" : [
2
],
"type" : "FLOAT32",
"name" : "input0",
"data_buffer" : [1,0,0,0]
},
{
"shape" : [
3
],
"type" : "FLOAT32",
"name" : "input1",
"data_buffer" : []
},
{
"shape" : [
3
],
"type" : "FLOAT32",
"name" : "out1",
"data_buffer" : []
},
{
"shape" : [
3
],
"type" : "FLOAT32",
"name" : "out2",
"data_buffer" : []
}
],
}
],
"operator_codes": [
{
"builtin_code": 0
},
{
"custom_code": "testing_op"
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.