Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
码匠许师傅
Tflite Micro
提交
74664fa8
T
Tflite Micro
项目概览
码匠许师傅
/
Tflite Micro
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tflite Micro
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
74664fa8
编写于
8月 03, 2022
作者:
S
Steven Toribio
提交者:
GitHub
8月 03, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
syncing with google3 change (#1301)
上级
313630de
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
4 deletion
+21
-4
tensorflow/lite/micro/kernels/kernel_util.cc
tensorflow/lite/micro/kernels/kernel_util.cc
+3
-2
tensorflow/lite/micro/kernels/kernel_util.h
tensorflow/lite/micro/kernels/kernel_util.h
+2
-1
tensorflow/lite/micro/micro_interpreter.cc
tensorflow/lite/micro/micro_interpreter.cc
+10
-0
tensorflow/lite/micro/micro_interpreter.h
tensorflow/lite/micro/micro_interpreter.h
+6
-1
未找到文件。
tensorflow/lite/micro/kernels/kernel_util.cc
浏览文件 @
74664fa8
...
...
@@ -40,9 +40,10 @@ int ValidateTensorIndexing(const TfLiteContext* context, int index,
TfLiteRegistration
RegisterOp
(
void
*
(
*
init
)(
TfLiteContext
*
context
,
const
char
*
buffer
,
size_t
length
),
TfLiteStatus
(
*
prepare
)(
TfLiteContext
*
context
,
TfLiteNode
*
node
),
TfLiteStatus
(
*
invoke
)(
TfLiteContext
*
context
,
TfLiteNode
*
node
))
{
TfLiteStatus
(
*
invoke
)(
TfLiteContext
*
context
,
TfLiteNode
*
node
),
void
(
*
free
)(
TfLiteContext
*
context
,
void
*
buffer
))
{
return
{
/*init=*/
init
,
/*free=*/
nullptr
,
/*free=*/
free
,
/*prepare=*/
prepare
,
/*invoke=*/
invoke
,
/*profiling_string=*/
nullptr
,
...
...
tensorflow/lite/micro/kernels/kernel_util.h
浏览文件 @
74664fa8
...
...
@@ -31,7 +31,8 @@ namespace micro {
TfLiteRegistration
RegisterOp
(
void
*
(
*
init
)(
TfLiteContext
*
context
,
const
char
*
buffer
,
size_t
length
),
TfLiteStatus
(
*
prepare
)(
TfLiteContext
*
context
,
TfLiteNode
*
node
),
TfLiteStatus
(
*
invoke
)(
TfLiteContext
*
context
,
TfLiteNode
*
node
));
TfLiteStatus
(
*
invoke
)(
TfLiteContext
*
context
,
TfLiteNode
*
node
),
void
(
*
free
)(
TfLiteContext
*
context
,
void
*
buffer
)
=
nullptr
);
// Prints out n bytes in a int8_t buffer as hex
void
PrintNBytes
(
const
int8_t
*
tensor_data
,
int
n_bytes
,
...
...
tensorflow/lite/micro/micro_interpreter.cc
浏览文件 @
74664fa8
...
...
@@ -317,7 +317,17 @@ TfLiteTensor* MicroInterpreter::output(size_t index) {
}
return
output_tensors_
[
index
];
}
// Repurposing free subgraphs to reset state for some ops for now
// will reset api is made. See b/220940833#comment25 for more context.
TfLiteStatus
MicroInterpreter
::
Reset
()
{
TfLiteStatus
status
=
graph_
.
FreeSubgraphs
();
if
(
status
!=
kTfLiteOk
)
{
return
status
;
}
return
graph_
.
ResetVariableTensors
();
}
// TODO: remove this API completely in favor of MicroInterpreter::Reset
TfLiteStatus
MicroInterpreter
::
ResetVariableTensors
()
{
return
graph_
.
ResetVariableTensors
();
}
...
...
tensorflow/lite/micro/micro_interpreter.h
浏览文件 @
74664fa8
...
...
@@ -31,7 +31,7 @@ limitations under the License.
#include "tensorflow/lite/portable_type_to_tflitetype.h"
#include "tensorflow/lite/schema/schema_generated.h"
// Copied from tensorflow/lite/version.h to avoid a dependency chain into
//
/
Copied from tensorflow/lite/version.h to avoid a dependency chain into
// tensorflow/core.
#define TFLITE_SCHEMA_VERSION (3)
...
...
@@ -116,6 +116,11 @@ class MicroInterpreter {
return
nullptr
;
}
// Reset the state to be what you would expect when the interpreter is first
// created. i.e. after Init and Prepare is called for the very first time.
TfLiteStatus
Reset
();
// TODO: remove this in favor of Reset()
// Reset all variable tensors to the default value.
TfLiteStatus
ResetVariableTensors
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录