Browse Source

Added signature for eager execute

Added fix for album, removed ifdef
tags/v1.1.0
Eric 5 years ago
parent
commit
16673fbca9
20 changed files with 46 additions and 93 deletions
  1. +24
    -0
      mindspore/ccsrc/minddata/dataset/api/execute.cc
  2. +2
    -5
      mindspore/ccsrc/minddata/dataset/engine/cache/cache_grpc_server.cc
  3. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/data_schema.cc
  4. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.cc
  5. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc
  6. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc
  7. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc
  8. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc
  9. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc
  10. +1
    -6
      mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc
  11. +1
    -6
      mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc
  12. +1
    -6
      mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc
  13. +2
    -2
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.cc
  14. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.cc
  15. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc
  16. +1
    -6
      mindspore/ccsrc/minddata/dataset/engine/gnn/graph_shared_memory.cc
  17. +1
    -6
      mindspore/ccsrc/minddata/dataset/engine/gnn/grpc_async_server.cc
  18. +1
    -5
      mindspore/ccsrc/minddata/dataset/engine/perf/profiling.cc
  19. +1
    -6
      mindspore/ccsrc/minddata/dataset/engine/tdt/tdt_plugin.cc
  20. +2
    -0
      mindspore/ccsrc/minddata/dataset/include/execute.h

+ 24
- 0
mindspore/ccsrc/minddata/dataset/api/execute.cc View File

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

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 mindspore

+ 2
- 5
mindspore/ccsrc/minddata/dataset/engine/cache/cache_grpc_server.cc View File

@@ -19,11 +19,8 @@
#include "minddata/dataset/engine/cache/cache_server.h"
#include "minddata/dataset/util/path.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 dataset {
CacheServerGreeterImpl::CacheServerGreeterImpl(int32_t port, int32_t shared_memory_sz_in_gb)


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/data_schema.cc View File

@@ -26,11 +26,7 @@
#include "utils/ms_utils.h"
#include "minddata/dataset/util/status.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/cache_op.cc View File

@@ -25,12 +25,8 @@
#include "minddata/dataset/engine/data_buffer.h"
#include "minddata/dataset/engine/execution_tree.h"
#include "minddata/dataset/engine/opt/pass.h"
#include "minddata/dataset/util/log_adapter.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/epoch_ctrl_op.cc View File

@@ -22,11 +22,7 @@
#include "minddata/dataset/engine/data_buffer.h"
#include "minddata/dataset/engine/db_connector.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/filter_op.cc View File

@@ -29,11 +29,7 @@
#include "minddata/dataset/engine/execution_tree.h"
#include "minddata/dataset/engine/opt/pass.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"

namespace mindspore {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc View File

@@ -28,12 +28,8 @@
#include "minddata/dataset/engine/datasetops/map_op/gpu_map_job.h"
#include "minddata/dataset/engine/opt/pass.h"
#include "minddata/dataset/kernels/tensor_op.h"
#include "minddata/dataset/util/log_adapter.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/project_op.cc View File

@@ -26,11 +26,7 @@
#include "minddata/dataset/engine/db_connector.h"
#include "minddata/dataset/engine/execution_tree.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc View File

@@ -25,11 +25,7 @@
#include "minddata/dataset/engine/data_buffer.h"
#include "minddata/dataset/engine/db_connector.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 dataset {


+ 1
- 6
mindspore/ccsrc/minddata/dataset/engine/datasetops/repeat_op.cc View File

@@ -22,12 +22,7 @@
#include "minddata/dataset/engine/data_buffer.h"
#include "minddata/dataset/engine/db_connector.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 dataset {


+ 1
- 6
mindspore/ccsrc/minddata/dataset/engine/datasetops/shuffle_op.cc View File

@@ -31,15 +31,10 @@
#include "minddata/dataset/engine/data_buffer.h"
#include "minddata/dataset/engine/db_connector.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/status.h"

#ifndef ENABLE_ANDROID
#include "utils/log_adapter.h"
#else
#include "mindspore/lite/src/common/log_adapter.h"
#endif

namespace mindspore {
namespace dataset {
constexpr int32_t ShuffleOp::kShuffleStateInit;


+ 1
- 6
mindspore/ccsrc/minddata/dataset/engine/datasetops/skip_op.cc View File

@@ -23,12 +23,7 @@
#include "minddata/dataset/engine/db_connector.h"
#include "minddata/dataset/engine/execution_tree.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 dataset {


+ 2
- 2
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/album_op.cc View File

@@ -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);
if (fs.fail()) {
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 << ".";


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/mindrecord_op.cc View File

@@ -30,11 +30,7 @@
#include "minddata/dataset/engine/db_connector.h"
#include "minddata/dataset/engine/execution_tree.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/datasetops/zip_op.cc View File

@@ -23,11 +23,7 @@
#include "minddata/dataset/engine/opt/pass.h"
#include "minddata/dataset/core/config_manager.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 dataset {


+ 1
- 6
mindspore/ccsrc/minddata/dataset/engine/gnn/graph_shared_memory.cc View File

@@ -17,12 +17,7 @@
#include "minddata/dataset/engine/gnn/graph_shared_memory.h"

#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 dataset {


+ 1
- 6
mindspore/ccsrc/minddata/dataset/engine/gnn/grpc_async_server.cc View File

@@ -16,13 +16,8 @@
#include "minddata/dataset/engine/gnn/grpc_async_server.h"

#include <limits>
#include "minddata/dataset/util/log_adapter.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 dataset {


+ 1
- 5
mindspore/ccsrc/minddata/dataset/engine/perf/profiling.cc View File

@@ -25,11 +25,7 @@
#include "minddata/dataset/engine/perf/connector_size.h"
#include "minddata/dataset/engine/perf/connector_throughput.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 dataset {


+ 1
- 6
mindspore/ccsrc/minddata/dataset/engine/tdt/tdt_plugin.cc View File

@@ -15,13 +15,8 @@
*/
#include "minddata/dataset/engine/tdt/tdt_plugin.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/util/log_adapter.h"
namespace mindspore {
namespace dataset {
static std::shared_ptr<TdtPlugin> instance_ptr_ = nullptr;


+ 2
- 0
mindspore/ccsrc/minddata/dataset/include/execute.h View File

@@ -21,6 +21,7 @@
#include <memory>
#include "minddata/dataset/core/constants.h"
#include "minddata/dataset/include/de_tensor.h"
#include "minddata/dataset/include/tensor.h"
#include "minddata/dataset/include/transforms.h"

namespace mindspore {
@@ -38,6 +39,7 @@ class Execute {
/// \param[inout] input - the tensor to be transformed
/// \return - the output tensor, nullptr if Compute fails
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:
std::shared_ptr<TensorOperation> op_;


Loading…
Cancel
Save