| @@ -53,5 +53,29 @@ std::shared_ptr<tensor::MSTensor> Execute::operator()(std::shared_ptr<tensor::MS | |||||
| return std::make_shared<tensor::DETensor>(std::move(de_output)); | return std::make_shared<tensor::DETensor>(std::move(de_output)); | ||||
| } | } | ||||
| std::shared_ptr<dataset::Tensor> Execute::operator()(std::shared_ptr<dataset::Tensor> input) { | |||||
| // Build the op | |||||
| if (op_ == nullptr) { | |||||
| MS_LOG(ERROR) << "Input TensorOperation is not valid"; | |||||
| return nullptr; | |||||
| } | |||||
| if (input == nullptr) { | |||||
| MS_LOG(ERROR) << "Input Tensor is not valid"; | |||||
| return nullptr; | |||||
| } | |||||
| // will add validate params once API is set | |||||
| std::shared_ptr<TensorOp> transform = op_->Build(); | |||||
| std::shared_ptr<Tensor> de_output; | |||||
| Status rc = transform->Compute(input, &de_output); | |||||
| if (rc.IsError()) { | |||||
| // execution failed | |||||
| MS_LOG(ERROR) << "Operation execution failed : " << rc.ToString(); | |||||
| return nullptr; | |||||
| } | |||||
| return de_output; | |||||
| } | |||||
| } // namespace dataset | } // namespace dataset | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -19,11 +19,8 @@ | |||||
| #include "minddata/dataset/engine/cache/cache_server.h" | #include "minddata/dataset/engine/cache/cache_server.h" | ||||
| #include "minddata/dataset/util/path.h" | #include "minddata/dataset/util/path.h" | ||||
| #include "minddata/dataset/util/task_manager.h" | #include "minddata/dataset/util/task_manager.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| CacheServerGreeterImpl::CacheServerGreeterImpl(int32_t port, int32_t shared_memory_sz_in_gb) | CacheServerGreeterImpl::CacheServerGreeterImpl(int32_t port, int32_t shared_memory_sz_in_gb) | ||||
| @@ -26,11 +26,7 @@ | |||||
| #include "utils/ms_utils.h" | #include "utils/ms_utils.h" | ||||
| #include "minddata/dataset/util/status.h" | #include "minddata/dataset/util/status.h" | ||||
| #include "minddata/dataset/core/tensor_shape.h" | #include "minddata/dataset/core/tensor_shape.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -25,12 +25,8 @@ | |||||
| #include "minddata/dataset/engine/data_buffer.h" | #include "minddata/dataset/engine/data_buffer.h" | ||||
| #include "minddata/dataset/engine/execution_tree.h" | #include "minddata/dataset/engine/execution_tree.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| #include "minddata/dataset/util/task_manager.h" | #include "minddata/dataset/util/task_manager.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -22,11 +22,7 @@ | |||||
| #include "minddata/dataset/engine/data_buffer.h" | #include "minddata/dataset/engine/data_buffer.h" | ||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -29,11 +29,7 @@ | |||||
| #include "minddata/dataset/engine/execution_tree.h" | #include "minddata/dataset/engine/execution_tree.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #include "minddata/dataset/kernels/tensor_op.h" | #include "minddata/dataset/kernels/tensor_op.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| #include "minddata/dataset/util/task_manager.h" | #include "minddata/dataset/util/task_manager.h" | ||||
| namespace mindspore { | namespace mindspore { | ||||
| @@ -28,12 +28,8 @@ | |||||
| #include "minddata/dataset/engine/datasetops/map_op/gpu_map_job.h" | #include "minddata/dataset/engine/datasetops/map_op/gpu_map_job.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #include "minddata/dataset/kernels/tensor_op.h" | #include "minddata/dataset/kernels/tensor_op.h" | ||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| #include "minddata/dataset/util/task_manager.h" | #include "minddata/dataset/util/task_manager.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -26,11 +26,7 @@ | |||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/execution_tree.h" | #include "minddata/dataset/engine/execution_tree.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -25,11 +25,7 @@ | |||||
| #include "minddata/dataset/engine/data_buffer.h" | #include "minddata/dataset/engine/data_buffer.h" | ||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -22,12 +22,7 @@ | |||||
| #include "minddata/dataset/engine/data_buffer.h" | #include "minddata/dataset/engine/data_buffer.h" | ||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -31,15 +31,10 @@ | |||||
| #include "minddata/dataset/engine/data_buffer.h" | #include "minddata/dataset/engine/data_buffer.h" | ||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| #include "minddata/dataset/util/random.h" | #include "minddata/dataset/util/random.h" | ||||
| #include "minddata/dataset/util/status.h" | #include "minddata/dataset/util/status.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| constexpr int32_t ShuffleOp::kShuffleStateInit; | constexpr int32_t ShuffleOp::kShuffleStateInit; | ||||
| @@ -23,12 +23,7 @@ | |||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/execution_tree.h" | #include "minddata/dataset/engine/execution_tree.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -265,8 +265,8 @@ Status AlbumOp::LoadImageTensor(const std::string &image_file_path, uint32_t col | |||||
| fs.open(image_file_path, std::ios::binary | std::ios::in); | fs.open(image_file_path, std::ios::binary | std::ios::in); | ||||
| if (fs.fail()) { | if (fs.fail()) { | ||||
| MS_LOG(INFO) << "Image file not found:" << image_file_path << "."; | MS_LOG(INFO) << "Image file not found:" << image_file_path << "."; | ||||
| // If file doesn't exist, we don't flag this as error in input check, simply skip | |||||
| return Status::OK(); | |||||
| // If file doesn't exist, we don't flag this as error in input check, simply push back empty tensor | |||||
| RETURN_STATUS_UNEXPECTED("Invalid file_path, failed to read file: " + image_file_path); | |||||
| } | } | ||||
| MS_LOG(INFO) << "Image file found: " << image_file_path << "."; | MS_LOG(INFO) << "Image file found: " << image_file_path << "."; | ||||
| @@ -30,11 +30,7 @@ | |||||
| #include "minddata/dataset/engine/db_connector.h" | #include "minddata/dataset/engine/db_connector.h" | ||||
| #include "minddata/dataset/engine/execution_tree.h" | #include "minddata/dataset/engine/execution_tree.h" | ||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -23,11 +23,7 @@ | |||||
| #include "minddata/dataset/engine/opt/pass.h" | #include "minddata/dataset/engine/opt/pass.h" | ||||
| #include "minddata/dataset/core/config_manager.h" | #include "minddata/dataset/core/config_manager.h" | ||||
| #include "minddata/dataset/core/global_context.h" | #include "minddata/dataset/core/global_context.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -17,12 +17,7 @@ | |||||
| #include "minddata/dataset/engine/gnn/graph_shared_memory.h" | #include "minddata/dataset/engine/gnn/graph_shared_memory.h" | ||||
| #include <string> | #include <string> | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -16,13 +16,8 @@ | |||||
| #include "minddata/dataset/engine/gnn/grpc_async_server.h" | #include "minddata/dataset/engine/gnn/grpc_async_server.h" | ||||
| #include <limits> | #include <limits> | ||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| #include "minddata/dataset/util/task_manager.h" | #include "minddata/dataset/util/task_manager.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -25,11 +25,7 @@ | |||||
| #include "minddata/dataset/engine/perf/connector_size.h" | #include "minddata/dataset/engine/perf/connector_size.h" | ||||
| #include "minddata/dataset/engine/perf/connector_throughput.h" | #include "minddata/dataset/engine/perf/connector_throughput.h" | ||||
| #include "minddata/dataset/engine/perf/dataset_iterator_tracing.h" | #include "minddata/dataset/engine/perf/dataset_iterator_tracing.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| @@ -15,13 +15,8 @@ | |||||
| */ | */ | ||||
| #include "minddata/dataset/engine/tdt/tdt_plugin.h" | #include "minddata/dataset/engine/tdt/tdt_plugin.h" | ||||
| #include "utils/ms_utils.h" | #include "utils/ms_utils.h" | ||||
| #ifndef ENABLE_ANDROID | |||||
| #include "utils/log_adapter.h" | |||||
| #else | |||||
| #include "mindspore/lite/src/common/log_adapter.h" | |||||
| #endif | |||||
| #include "minddata/dataset/engine/perf/profiling.h" | #include "minddata/dataset/engine/perf/profiling.h" | ||||
| #include "minddata/dataset/util/log_adapter.h" | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace dataset { | namespace dataset { | ||||
| static std::shared_ptr<TdtPlugin> instance_ptr_ = nullptr; | static std::shared_ptr<TdtPlugin> instance_ptr_ = nullptr; | ||||
| @@ -21,6 +21,7 @@ | |||||
| #include <memory> | #include <memory> | ||||
| #include "minddata/dataset/core/constants.h" | #include "minddata/dataset/core/constants.h" | ||||
| #include "minddata/dataset/include/de_tensor.h" | #include "minddata/dataset/include/de_tensor.h" | ||||
| #include "minddata/dataset/include/tensor.h" | |||||
| #include "minddata/dataset/include/transforms.h" | #include "minddata/dataset/include/transforms.h" | ||||
| namespace mindspore { | namespace mindspore { | ||||
| @@ -38,6 +39,7 @@ class Execute { | |||||
| /// \param[inout] input - the tensor to be transformed | /// \param[inout] input - the tensor to be transformed | ||||
| /// \return - the output tensor, nullptr if Compute fails | /// \return - the output tensor, nullptr if Compute fails | ||||
| std::shared_ptr<tensor::MSTensor> operator()(std::shared_ptr<tensor::MSTensor> input); | std::shared_ptr<tensor::MSTensor> operator()(std::shared_ptr<tensor::MSTensor> input); | ||||
| std::shared_ptr<dataset::Tensor> operator()(std::shared_ptr<dataset::Tensor> input); | |||||
| private: | private: | ||||
| std::shared_ptr<TensorOperation> op_; | std::shared_ptr<TensorOperation> op_; | ||||