Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
71982329
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
71982329
编写于
7月 31, 2020
作者:
E
ervinzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rebased again
上级
6ace46d5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
6 deletion
+19
-6
build.sh
build.sh
+6
-0
mindspore/lite/test/CMakeLists.txt
mindspore/lite/test/CMakeLists.txt
+8
-1
mindspore/lite/test/ut/src/dataset/de_tensor_test.cc
mindspore/lite/test/ut/src/dataset/de_tensor_test.cc
+4
-4
mindspore/lite/test/ut/src/dataset/eager_test.cc
mindspore/lite/test/ut/src/dataset/eager_test.cc
+1
-1
未找到文件。
build.sh
浏览文件 @
71982329
...
...
@@ -519,6 +519,11 @@ build_opencl() {
fi
}
build_gtest
()
{
cd
${
BASEPATH
}
git submodule update
--init
--recursive
third_party/googletest
}
build_opencv
()
{
cd
${
BASEPATH
}
if
[[
"
${
INC_BUILD
}
"
==
"off"
]]
;
then
...
...
@@ -561,6 +566,7 @@ build_minddata_lite_deps()
build_opencv
build_eigen
build_jpeg_turbo
build_gtest
}
build_lite
()
...
...
mindspore/lite/test/CMakeLists.txt
浏览文件 @
71982329
...
...
@@ -132,7 +132,7 @@ endif()
### minddata lite
if
(
BUILD_MINDDATA
)
include_directories
(
${
CCSRC_DIR
}
/minddata
)
set
(
DATASET_TEST_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/dataset
)
set
(
DATASET_TEST_DIR
${
TEST_DIR
}
/ut/src
/dataset
)
set
(
TEST_MINDDATA_SRC
${
DATASET_TEST_DIR
}
/de_tensor_test.cc
${
DATASET_TEST_DIR
}
/eager_test.cc
...
...
@@ -294,6 +294,13 @@ endif ()
add_executable
(
lite-test
${
TEST_SRC
}
)
target_link_libraries
(
lite-test dl
${
SECUREC_LIBRARY
}
${
GTEST_LIBRARY
}
mindspore::json
)
if
(
BUILD_MINDDATA
)
target_link_libraries
(
lite-test
minddata-lite
minddata-eager
log
)
endif
()
if
(
BUILD_CONVERTER
)
target_link_libraries
(
lite-test
anf_exporter_mid
...
...
mindspore/lite/test/dataset/de_tensor_test.cc
→
mindspore/lite/test/
ut/src/
dataset/de_tensor_test.cc
浏览文件 @
71982329
...
...
@@ -25,7 +25,7 @@
using
namespace
mindspore
::
dataset
;
class
MindDataTestTensorDE
:
public
UT
::
Common
{
class
MindDataTestTensorDE
:
public
mindspore
::
Common
{
public:
MindDataTestTensorDE
()
{}
};
...
...
@@ -42,7 +42,7 @@ TEST_F(MindDataTestTensorDE, MSTensorConvertToLiteTensor) {
std
::
shared_ptr
<
mindspore
::
tensor
::
MSTensor
>
lite_ms_tensor
=
std
::
shared_ptr
<
mindspore
::
tensor
::
MSTensor
>
(
std
::
dynamic_pointer_cast
<
mindspore
::
tensor
::
DETensor
>
(
ms_tensor
)
->
ConvertToLiteTensor
());
// check if the lite_ms_tensor is the derived LiteTensor
mindspore
::
tensor
::
LiteTensor
*
lite_tensor
=
static_cast
<
mindspor
e
::
tensor
::
LiteTensor
*>
(
lite_ms_tensor
.
get
());
mindspore
::
lite
::
tensor
::
LiteTensor
*
lite_tensor
=
static_cast
<
mindspore
::
lit
e
::
tensor
::
LiteTensor
*>
(
lite_ms_tensor
.
get
());
ASSERT_EQ
(
lite_tensor
!=
nullptr
,
true
);
}
...
...
@@ -77,7 +77,7 @@ TEST_F(MindDataTestTensorDE, MSTensorDataType) {
TEST_F
(
MindDataTestTensorDE
,
MSTensorMutableData
)
{
std
::
vector
<
float
>
x
=
{
2.5
,
2.5
,
2.5
,
2.5
};
std
::
shared_ptr
<
Tensor
>
t
;
Tensor
::
Create
Tensor
(
&
t
,
x
,
TensorShape
({
2
,
2
})
);
Tensor
::
Create
FromVector
(
x
,
TensorShape
({
2
,
2
}),
&
t
);
auto
ms_tensor
=
std
::
shared_ptr
<
mindspore
::
tensor
::
MSTensor
>
(
new
mindspore
::
tensor
::
DETensor
(
t
));
float
*
data
=
static_cast
<
float
*>
(
ms_tensor
->
MutableData
());
std
::
vector
<
float
>
tensor_vec
(
data
,
data
+
ms_tensor
->
ElementsNum
());
...
...
@@ -88,7 +88,7 @@ TEST_F(MindDataTestTensorDE, MSTensorMutableData) {
TEST_F
(
MindDataTestTensorDE
,
MSTensorHash
)
{
std
::
vector
<
float
>
x
=
{
2.5
,
2.5
,
2.5
,
2.5
};
std
::
shared_ptr
<
Tensor
>
t
;
Tensor
::
Create
Tensor
(
&
t
,
x
,
TensorShape
({
2
,
2
})
);
Tensor
::
Create
FromVector
(
x
,
TensorShape
({
2
,
2
}),
&
t
);
auto
ms_tensor
=
std
::
shared_ptr
<
mindspore
::
tensor
::
MSTensor
>
(
new
mindspore
::
tensor
::
DETensor
(
t
));
#ifdef ENABLE_ARM64
ASSERT_EQ
(
ms_tensor
->
hash
()
==
11093771382437
,
true
);
// arm64
...
...
mindspore/lite/test/dataset/eager_test.cc
→
mindspore/lite/test/
ut/src/
dataset/eager_test.cc
浏览文件 @
71982329
...
...
@@ -27,7 +27,7 @@ using namespace mindspore::dataset;
using
namespace
mindspore
::
dataset
::
api
;
using
namespace
mindspore
;
class
MindDataTestEager
:
public
UT
::
Common
{
class
MindDataTestEager
:
public
mindspore
::
Common
{
public:
MindDataTestEager
()
{}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录