Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
6ace46d5
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看板
提交
6ace46d5
编写于
7月 30, 2020
作者:
E
Eric
提交者:
ervinzhang
8月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added preprocessor, cmake directory pending
上级
50dcb79b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
30 addition
and
1 deletion
+30
-1
mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc
mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc
+6
-0
mindspore/ccsrc/minddata/dataset/engine/opt/pass.h
mindspore/ccsrc/minddata/dataset/engine/opt/pass.h
+4
-0
mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.cc
...c/minddata/dataset/engine/opt/pre/cache_transform_pass.cc
+11
-0
mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.h
...rc/minddata/dataset/engine/opt/pre/cache_transform_pass.h
+5
-0
mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc
...re/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc
+2
-1
mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h
...ore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h
+2
-0
未找到文件。
mindspore/ccsrc/minddata/dataset/engine/opt/pass.cc
浏览文件 @
6ace46d5
...
...
@@ -34,10 +34,14 @@
#include "minddata/dataset/engine/datasetops/source/cifar_op.h"
#include "minddata/dataset/engine/datasetops/source/coco_op.h"
#include "minddata/dataset/engine/datasetops/source/manifest_op.h"
#ifndef ENABLE_ANDROID
#include "minddata/dataset/engine/datasetops/source/mindrecord_op.h"
#endif
#include "minddata/dataset/engine/datasetops/source/mnist_op.h"
#include "minddata/dataset/engine/datasetops/source/random_data_op.h"
#ifndef ENABLE_ANDROID
#include "minddata/dataset/engine/datasetops/source/tf_reader_op.h"
#endif
#include "minddata/dataset/engine/datasetops/source/voc_op.h"
#ifdef ENABLE_PYTHON
#include "minddata/dataset/engine/datasetops/filter_op.h"
...
...
@@ -136,6 +140,7 @@ Status NodePass::RunOnNode(std::shared_ptr<ShuffleOp> node, bool *modified) {
return
RunOnNode
(
std
::
static_pointer_cast
<
DatasetOp
>
(
node
),
modified
);
}
#ifndef ENABLE_ANDROID
Status
NodePass
::
RunOnNode
(
std
::
shared_ptr
<
MindRecordOp
>
node
,
bool
*
modified
)
{
// Fallback to base class visitor by default
return
RunOnNode
(
std
::
static_pointer_cast
<
DatasetOp
>
(
node
),
modified
);
...
...
@@ -145,6 +150,7 @@ Status NodePass::RunOnNode(std::shared_ptr<TFReaderOp> node, bool *modified) {
// Fallback to base class visitor by default
return
RunOnNode
(
std
::
static_pointer_cast
<
DatasetOp
>
(
node
),
modified
);
}
#endif
#ifdef ENABLE_PYTHON
Status
NodePass
::
RunOnNode
(
std
::
shared_ptr
<
FilterOp
>
node
,
bool
*
modified
)
{
...
...
mindspore/ccsrc/minddata/dataset/engine/opt/pass.h
浏览文件 @
6ace46d5
...
...
@@ -37,9 +37,11 @@ class SkipOp;
class
ShuffleOp
;
#ifndef ENABLE_ANDROID
class
MindRecordOp
;
class
TFReaderOp
;
#endif
#ifdef ENABLE_PYTHON
class
FilterOp
;
...
...
@@ -158,9 +160,11 @@ class NodePass : public Pass {
virtual
Status
RunOnNode
(
std
::
shared_ptr
<
ShuffleOp
>
node
,
bool
*
modified
);
#ifndef ENABLE_ANDROID
virtual
Status
RunOnNode
(
std
::
shared_ptr
<
MindRecordOp
>
node
,
bool
*
modified
);
virtual
Status
RunOnNode
(
std
::
shared_ptr
<
TFReaderOp
>
node
,
bool
*
modified
);
#endif
#ifdef ENABLE_PYTHON
virtual
Status
RunOnNode
(
std
::
shared_ptr
<
FilterOp
>
node
,
bool
*
modified
);
...
...
mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.cc
浏览文件 @
6ace46d5
...
...
@@ -25,10 +25,17 @@
#include "minddata/dataset/engine/datasetops/source/cifar_op.h"
#include "minddata/dataset/engine/datasetops/source/coco_op.h"
#include "minddata/dataset/engine/datasetops/source/image_folder_op.h"
#ifndef ENABLE_ANDROID
#include "minddata/dataset/engine/datasetops/source/mindrecord_op.h"
#endif
#include "minddata/dataset/engine/datasetops/source/mnist_op.h"
#include "minddata/dataset/engine/datasetops/source/random_data_op.h"
#ifndef ENABLE_ANDROID
#include "minddata/dataset/engine/datasetops/source/tf_reader_op.h"
#endif
#ifdef ENABLE_PYTHON
#include "minddata/dataset/engine/datasetops/source/generator_op.h"
...
...
@@ -123,6 +130,7 @@ Status CacheTransformPass::CachePass::NonMappableCacheLeafSetup(std::shared_ptr<
return
Status
::
OK
();
}
#ifndef ENABLE_ANDROID
// Perform leaf node cache transform identification
Status
CacheTransformPass
::
CachePass
::
RunOnNode
(
std
::
shared_ptr
<
TFReaderOp
>
node
,
bool
*
modified
)
{
if
(
is_caching_
)
{
...
...
@@ -132,6 +140,7 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr<TFReaderOp> node
}
return
NonMappableCacheLeafSetup
(
std
::
static_pointer_cast
<
DatasetOp
>
(
node
));
}
#endif
// Perform leaf node cache transform identification
Status
CacheTransformPass
::
CachePass
::
RunOnNode
(
std
::
shared_ptr
<
RandomDataOp
>
node
,
bool
*
modified
)
{
...
...
@@ -163,10 +172,12 @@ Status CacheTransformPass::CachePass::RunOnNode(std::shared_ptr<CelebAOp> node,
return
MappableCacheLeafSetup
(
std
::
static_pointer_cast
<
DatasetOp
>
(
node
));
}
#ifndef ENABLE_ANDROID
// Perform leaf node cache transform identification
Status
CacheTransformPass
::
CachePass
::
RunOnNode
(
std
::
shared_ptr
<
MindRecordOp
>
node
,
bool
*
modified
)
{
return
MappableCacheLeafSetup
(
std
::
static_pointer_cast
<
DatasetOp
>
(
node
));
}
#endif
#ifdef ENABLE_PYTHON
// Perform leaf node cache transform identification
...
...
mindspore/ccsrc/minddata/dataset/engine/opt/pre/cache_transform_pass.h
浏览文件 @
6ace46d5
...
...
@@ -58,11 +58,14 @@ class CacheTransformPass : public TreePass {
/// \return Status The error code return
Status
RunOnNode
(
std
::
shared_ptr
<
CacheOp
>
node
,
bool
*
modified
)
override
;
#ifndef ENABLE_ANDROID
/// \brief Perform leaf node cache tranform identifications
/// \param[in] node The node being visited
/// \param[inout] modified Indicator if the node was changed at all
/// \return Status The error code return
Status
RunOnNode
(
std
::
shared_ptr
<
TFReaderOp
>
node
,
bool
*
modified
)
override
;
#endif
/// \brief Perform leaf node cache tranform identifications
/// \param[in] node The node being visited
...
...
@@ -120,11 +123,13 @@ class CacheTransformPass : public TreePass {
/// \return Status The error code return
Status
RunOnNode
(
std
::
shared_ptr
<
CelebAOp
>
node
,
bool
*
modified
)
override
;
#ifndef ENABLE_ANDROID
/// \brief Perform leaf node cache tranform identifications
/// \param[in] node The node being visited
/// \param[inout] modified Indicator if the node was changed at all
/// \return Status The error code return
Status
RunOnNode
(
std
::
shared_ptr
<
MindRecordOp
>
node
,
bool
*
modified
)
override
;
#endif
/// \brief Getter
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
DatasetOp
>
,
std
::
shared_ptr
<
CacheOp
>>>
cache_pairs
()
{
return
cache_pairs_
;
}
...
...
mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.cc
浏览文件 @
6ace46d5
...
...
@@ -60,7 +60,7 @@ Status PrinterPass::RunOnNode(std::shared_ptr<ShuffleOp> node, bool *modified) {
std
::
cout
<<
"Visiting ShuffleOp"
<<
'\n'
;
return
Status
::
OK
();
}
#ifndef ENABLE_ANDROID
Status
PrinterPass
::
RunOnNode
(
std
::
shared_ptr
<
MindRecordOp
>
node
,
bool
*
modified
)
{
*
modified
=
false
;
std
::
cout
<<
"Visiting MindRecordOp"
<<
'\n'
;
...
...
@@ -72,6 +72,7 @@ Status PrinterPass::RunOnNode(std::shared_ptr<TFReaderOp> node, bool *modified)
std
::
cout
<<
"Visiting TFReaderOp"
<<
'\n'
;
return
Status
::
OK
();
}
#endif
#ifdef ENABLE_PYTHON
Status
PrinterPass
::
RunOnNode
(
std
::
shared_ptr
<
FilterOp
>
node
,
bool
*
modified
)
{
...
...
mindspore/ccsrc/minddata/dataset/engine/opt/util/printer_pass.h
浏览文件 @
6ace46d5
...
...
@@ -39,9 +39,11 @@ class PrinterPass : public NodePass {
Status
RunOnNode
(
std
::
shared_ptr
<
ShuffleOp
>
node
,
bool
*
modified
)
override
;
#ifndef ENABLE_ANDROID
Status
RunOnNode
(
std
::
shared_ptr
<
MindRecordOp
>
node
,
bool
*
modified
)
override
;
Status
RunOnNode
(
std
::
shared_ptr
<
TFReaderOp
>
node
,
bool
*
modified
)
override
;
#endif
#ifdef ENABLE_PYTHON
Status
RunOnNode
(
std
::
shared_ptr
<
FilterOp
>
node
,
bool
*
modified
)
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录