Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
863bb0d3
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
863bb0d3
编写于
5月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8624 北向用例新增对离线模型接口、错误码参数的实现
Merge pull request !8624 from scholar-lc/weekly_20230411
上级
9746593c
8f44eb99
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
4 deletion
+13
-4
ai/neural_network_runtime/v2_0/common/mock_idevice.cpp
ai/neural_network_runtime/v2_0/common/mock_idevice.cpp
+8
-2
ai/neural_network_runtime/v2_0/common/mock_idevice.h
ai/neural_network_runtime/v2_0/common/mock_idevice.h
+4
-1
ai/neural_network_runtime/v2_0/interface/src/MemoryTest.cpp
ai/neural_network_runtime/v2_0/interface/src/MemoryTest.cpp
+1
-1
未找到文件。
ai/neural_network_runtime/v2_0/common/mock_idevice.cpp
浏览文件 @
863bb0d3
...
...
@@ -206,6 +206,13 @@ int32_t MockIDevice::PrepareModel(const Model& model, const ModelConfig& config,
return
HDF_SUCCESS
;
}
int32_t
MockIDevice
::
PrepareOfflineModel
(
const
std
::
vector
<
SharedBuffer
>&
offlineModels
,
const
ModelConfig
&
config
,
sptr
<
OHOS
::
HDI
::
Nnrt
::
V2_0
::
IPreparedModel
>&
preparedModel
)
{
preparedModel
=
new
(
std
::
nothrow
)
V2_0
::
MockIPreparedModel
();
return
V2_0
::
NNRT_ReturnCode
::
NNRT_SUCCESS
;
}
int32_t
MockIDevice
::
PrepareModelFromModelCache
(
const
std
::
vector
<
SharedBuffer
>&
modelCache
,
const
ModelConfig
&
config
,
sptr
<
IPreparedModel
>&
preparedModel
)
{
...
...
@@ -251,10 +258,9 @@ int32_t MockIPreparedModel::GetVersion(uint32_t &majorVersion, uint32_t &minorVe
}
int32_t
MockIPreparedModel
::
Run
(
const
std
::
vector
<
IOTensor
>&
inputs
,
const
std
::
vector
<
IOTensor
>&
outputs
,
std
::
vector
<
std
::
vector
<
int32_t
>>&
outputsDims
,
std
::
vector
<
bool
>&
isOutputBufferEnough
)
std
::
vector
<
std
::
vector
<
int32_t
>>&
outputsDims
)
{
outputsDims
=
{{
1
,
2
,
2
,
1
}};
isOutputBufferEnough
=
{
true
};
return
HDF_SUCCESS
;
}
...
...
ai/neural_network_runtime/v2_0/common/mock_idevice.h
浏览文件 @
863bb0d3
...
...
@@ -70,6 +70,9 @@ public:
int32_t
PrepareModel
(
const
Model
&
model
,
const
ModelConfig
&
config
,
sptr
<
IPreparedModel
>&
preparedModel
)
override
;
int32_t
PrepareOfflineModel
(
const
std
::
vector
<
SharedBuffer
>&
offlineModels
,
const
ModelConfig
&
config
,
sptr
<
OHOS
::
HDI
::
Nnrt
::
V2_0
::
IPreparedModel
>&
preparedModel
)
override
;
int32_t
PrepareModelFromModelCache
(
const
std
::
vector
<
SharedBuffer
>&
modelCache
,
const
ModelConfig
&
config
,
sptr
<
IPreparedModel
>&
preparedModel
)
override
;
...
...
@@ -108,7 +111,7 @@ class MockIPreparedModel : public IPreparedModel {
public:
int32_t
ExportModelCache
(
std
::
vector
<
SharedBuffer
>&
modelCache
)
override
;
int32_t
Run
(
const
std
::
vector
<
IOTensor
>&
inputs
,
const
std
::
vector
<
IOTensor
>&
outputs
,
std
::
vector
<
std
::
vector
<
int32_t
>>&
outputsDims
,
std
::
vector
<
bool
>&
isOutputBufferEnough
)
override
;
std
::
vector
<
std
::
vector
<
int32_t
>>&
outputsDims
)
override
;
int32_t
GetInputDimRanges
(
std
::
vector
<
std
::
vector
<
uint32_t
>>&
minInputDims
,
std
::
vector
<
std
::
vector
<
uint32_t
>>&
maxInputDims
)
override
;
int32_t
GetVersion
(
uint32_t
&
majorVersion
,
uint32_t
&
minorVersion
)
override
;
MockIPreparedModel
()
=
default
;
...
...
ai/neural_network_runtime/v2_0/interface/src/MemoryTest.cpp
浏览文件 @
863bb0d3
...
...
@@ -805,7 +805,7 @@ HWTEST_F(MemoryTest, SUB_AI_NNRt_Func_North_Executor_Memory_Run_0200, Function |
OH_NNExecutor
*
executor
=
OH_NNExecutor_Construct
(
compilation
);
ASSERT_NE
(
nullptr
,
executor
);
uint32_t
inputIndex
=
0
;
for
(
auto
i
=
0
;
i
<
graphArgs
.
operands
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
graphArgs
.
operands
.
size
();
i
++
)
{
const
OHNNOperandTest
&
operandTem
=
graphArgs
.
operands
[
i
];
auto
quantParam
=
operandTem
.
quantParam
;
OH_NN_Tensor
operand
=
{
operandTem
.
dataType
,
(
uint32_t
)
operandTem
.
shape
.
size
(),
operandTem
.
shape
.
data
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录