| @@ -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) { | |||
| @@ -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); | |||
| @@ -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 | |||
| @@ -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_; } | |||
| @@ -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) { | |||
| @@ -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; | |||