Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
c5cfb09e
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看板
提交
c5cfb09e
编写于
4月 20, 2020
作者:
M
ms_yan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Repair some MS_LOG problem
上级
679dbd27
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
7 deletion
+9
-7
mindspore/ccsrc/dataset/engine/datasetops/take_op.cc
mindspore/ccsrc/dataset/engine/datasetops/take_op.cc
+6
-4
tests/ut/cpp/dataset/take_op_test.cc
tests/ut/cpp/dataset/take_op_test.cc
+3
-3
未找到文件。
mindspore/ccsrc/dataset/engine/datasetops/take_op.cc
浏览文件 @
c5cfb09e
...
...
@@ -67,7 +67,7 @@ Status TakeOp::GetNextBuffer(std::unique_ptr<DataBuffer> *p_buffer, int32_t work
bool
last_repeat
=
!
BitTest
(
op_ctrl_flags_
,
kDeOpRepeated
)
||
BitTest
(
op_ctrl_flags_
,
kDeOpLastRepeat
);
if
(
take_count_
==
max_takes_
)
{
if
(
state_
==
OpState
::
kDeOpRunning
)
{
MS_LOG
(
INFO
)
<<
"m
eet max count and push-back eoe buffer."
;
MS_LOG
(
DEBUG
)
<<
"M
eet max count and push-back eoe buffer."
;
auto
eoe_buffer
=
std
::
make_unique
<
DataBuffer
>
(
0
,
DataBuffer
::
kDeBFlagEOE
);
*
p_buffer
=
std
::
move
(
eoe_buffer
);
state_
=
OpState
::
kDeOpIdle
;
...
...
@@ -80,11 +80,13 @@ Status TakeOp::GetNextBuffer(std::unique_ptr<DataBuffer> *p_buffer, int32_t work
RETURN_IF_NOT_OK
(
child_
[
0
]
->
GetNextBuffer
(
&
buf
,
worker_id
,
true
));
}
}
}
else
{
MS_LOG
(
INFO
)
<<
"m
eet max count and push-back eof buffer."
;
}
else
if
(
state_
==
OpState
::
kDeOpIdle
)
{
MS_LOG
(
DEBUG
)
<<
"M
eet max count and push-back eof buffer."
;
auto
eof_buffer
=
std
::
make_unique
<
DataBuffer
>
(
0
,
DataBuffer
::
kDeBFlagEOF
);
*
p_buffer
=
std
::
move
(
eof_buffer
);
take_count_
=
0
;
}
else
{
MS_LOG
(
WARNING
)
<<
"Invalid OpState: "
<<
state_
;
}
return
Status
::
OK
();
}
...
...
@@ -116,7 +118,7 @@ Status TakeOp::FillBuffer(std::unique_ptr<DataBuffer> *buffer, std::unique_ptr<D
*
data_buffer
=
std
::
move
(
*
buffer
);
take_count_
=
take_count_
+
buffer_size
;
}
else
{
MS_LOG
(
INFO
)
<<
"In last buffer: Push one buffer."
;
MS_LOG
(
DEBUG
)
<<
"In last buffer: Push one buffer."
;
std
::
unique_ptr
<
TensorQTable
>
new_tensor_table
=
std
::
make_unique
<
TensorQTable
>
();
while
(
take_count_
<
max_takes_
)
{
TensorRow
new_row
;
...
...
tests/ut/cpp/dataset/take_op_test.cc
浏览文件 @
c5cfb09e
...
...
@@ -69,7 +69,7 @@ TEST_F(MindDataTestTakeOp, TestTakeProject) {
rc
=
my_tree
->
AssignRoot
(
my_take_op
);
ASSERT_TRUE
(
rc
.
IsOk
());
MS_LOG
(
INFO
)
<<
"Launching tree and begin iteration."
;
MS_LOG
(
DEBUG
)
<<
"Launching tree and begin iteration."
;
rc
=
my_tree
->
Prepare
();
ASSERT_TRUE
(
rc
.
IsOk
());
...
...
@@ -85,13 +85,13 @@ TEST_F(MindDataTestTakeOp, TestTakeProject) {
int
row_count
=
0
;
while
(
!
tensor_list
.
empty
())
{
MS_LOG
(
INFO
)
<<
"Row display for row #: "
<<
row_count
<<
"."
;
MS_LOG
(
DEBUG
)
<<
"Row display for row #: "
<<
row_count
<<
"."
;
// Display the tensor by calling the printer on it
for
(
int
i
=
0
;
i
<
tensor_list
.
size
();
i
++
)
{
std
::
ostringstream
ss
;
ss
<<
"("
<<
tensor_list
[
i
]
<<
"): "
<<
*
tensor_list
[
i
]
<<
std
::
endl
;
MS_LOG
(
INFO
)
<<
"Tensor print: "
<<
ss
.
str
()
<<
"."
;
MS_LOG
(
DEBUG
)
<<
"Tensor print: "
<<
ss
.
str
()
<<
"."
;
}
rc
=
di
.
FetchNextTensorRow
(
&
tensor_list
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录