From 47f5e2867ddd63b9cf6f18c2ff58b6039e1b1b16 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 15 Mar 2021 19:04:05 -0400 Subject: [PATCH 01/10] Added input check fix to random rotation --- .../minddata/dataset/engine/ir/datasetops/sync_wait_node.cc | 2 +- mindspore/dataset/vision/c_transforms.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/sync_wait_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/sync_wait_node.cc index 6b9d19b0ed..79871503fe 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/sync_wait_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/sync_wait_node.cc @@ -46,7 +46,7 @@ Status SyncWaitNode::Build(std::vector> *const node_o // Right now barrier should only take num_rows_per_buffer = 1 // The reason for this is because having it otherwise can lead to blocking issues // See barrier_op.h for more details - int32_t rows_per_buffer = 1; + const int32_t rows_per_buffer = 1; auto op = std::make_shared(rows_per_buffer, connector_que_size_, condition_name_, callback_); op->set_total_repeats(GetTotalRepeats()); op->set_num_repeats_per_epoch(GetNumRepeatsPerEpoch()); diff --git a/mindspore/dataset/vision/c_transforms.py b/mindspore/dataset/vision/c_transforms.py index 42a5da9853..5ec0d6ce41 100644 --- a/mindspore/dataset/vision/c_transforms.py +++ b/mindspore/dataset/vision/c_transforms.py @@ -1114,6 +1114,11 @@ class RandomRotation(ImageTensorOperation): @check_random_rotation def __init__(self, degrees, resample=Inter.NEAREST, expand=False, center=None, fill_value=0): + if isinstance(degrees, numbers.Number): + degrees = degrees % 360 + if isinstance(degrees, (list, tuple)): + degrees = [degrees[0] % 360, degrees[1] % 360] + self.degrees = degrees self.resample = resample self.expand = expand From 9b921953f993dda9708e35195db638fdb76ae852 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 15 Mar 2021 22:07:59 -0400 Subject: [PATCH 02/10] misc issues --- mindspore/ccsrc/minddata/dataset/api/datasets.cc | 2 +- mindspore/ccsrc/minddata/dataset/api/execute.cc | 2 +- mindspore/ccsrc/minddata/dataset/core/de_tensor.cc | 2 +- mindspore/ccsrc/minddata/dataset/core/tensor.cc | 2 +- mindspore/ccsrc/minddata/dataset/{include => core}/type_id.h | 0 mindspore/ccsrc/minddata/dataset/include/datasets.h | 3 --- tests/ut/cpp/dataset/common/common.h | 2 +- 7 files changed, 5 insertions(+), 8 deletions(-) rename mindspore/ccsrc/minddata/dataset/{include => core}/type_id.h (100%) diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index dcdfc91f32..90e937c59a 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -26,8 +26,8 @@ #include "minddata/dataset/include/transforms.h" #include "minddata/dataset/util/path.h" #include "minddata/dataset/util/status.h" -#include "minddata/dataset/include/type_id.h" #include "minddata/dataset/core/client.h" +#include "minddata/dataset/core/type_id.h" #include "minddata/dataset/engine/consumers/tree_consumer.h" #include "minddata/dataset/kernels/c_func_op.h" diff --git a/mindspore/ccsrc/minddata/dataset/api/execute.cc b/mindspore/ccsrc/minddata/dataset/api/execute.cc index 491d02f3d5..ae572a0ae4 100644 --- a/mindspore/ccsrc/minddata/dataset/api/execute.cc +++ b/mindspore/ccsrc/minddata/dataset/api/execute.cc @@ -22,7 +22,7 @@ #include "minddata/dataset/core/device_tensor.h" #include "minddata/dataset/core/tensor_row.h" #include "minddata/dataset/core/tensor.h" -#include "minddata/dataset/include/type_id.h" +#include "minddata/dataset/core/type_id.h" #include "minddata/dataset/kernels/ir/tensor_operation.h" #include "minddata/dataset/kernels/tensor_op.h" #ifndef ENABLE_ANDROID diff --git a/mindspore/ccsrc/minddata/dataset/core/de_tensor.cc b/mindspore/ccsrc/minddata/dataset/core/de_tensor.cc index 372c55d567..d9ceb6acb4 100644 --- a/mindspore/ccsrc/minddata/dataset/core/de_tensor.cc +++ b/mindspore/ccsrc/minddata/dataset/core/de_tensor.cc @@ -18,7 +18,7 @@ #include "minddata/dataset/core/device_tensor.h" #include "minddata/dataset/include/constants.h" #include "minddata/dataset/core/data_type.h" -#include "minddata/dataset/include/type_id.h" +#include "minddata/dataset/core/type_id.h" #include "mindspore/core/ir/dtype/type_id.h" #include "utils/hashing.h" #ifndef ENABLE_ANDROID diff --git a/mindspore/ccsrc/minddata/dataset/core/tensor.cc b/mindspore/ccsrc/minddata/dataset/core/tensor.cc index 24369e2c99..e2325b66dd 100644 --- a/mindspore/ccsrc/minddata/dataset/core/tensor.cc +++ b/mindspore/ccsrc/minddata/dataset/core/tensor.cc @@ -24,7 +24,7 @@ #include #include -#include "minddata/dataset/include/type_id.h" +#include "minddata/dataset/core/type_id.h" #include "utils/ms_utils.h" #include "minddata/dataset/include/constants.h" diff --git a/mindspore/ccsrc/minddata/dataset/include/type_id.h b/mindspore/ccsrc/minddata/dataset/core/type_id.h similarity index 100% rename from mindspore/ccsrc/minddata/dataset/include/type_id.h rename to mindspore/ccsrc/minddata/dataset/core/type_id.h diff --git a/mindspore/ccsrc/minddata/dataset/include/datasets.h b/mindspore/ccsrc/minddata/dataset/include/datasets.h index 42c0ba5994..6bffdd6a9c 100644 --- a/mindspore/ccsrc/minddata/dataset/include/datasets.h +++ b/mindspore/ccsrc/minddata/dataset/include/datasets.h @@ -36,8 +36,6 @@ #include "minddata/dataset/include/json_fwd.hpp" #include "minddata/dataset/include/samplers.h" #include "minddata/dataset/include/text.h" -#include "minddata/dataset/include/type_id.h" -#include "minddata/dataset/engine/consumers/pull_based_tree_consumer.h" namespace mindspore { namespace dataset { @@ -53,7 +51,6 @@ class DatasetCache; class DatasetNode; class Iterator; -class PullBasedIteratorConsumer; class TensorOperation; class SchemaObj; diff --git a/tests/ut/cpp/dataset/common/common.h b/tests/ut/cpp/dataset/common/common.h index 3bf1491aa6..d99d17b13e 100644 --- a/tests/ut/cpp/dataset/common/common.h +++ b/tests/ut/cpp/dataset/common/common.h @@ -20,7 +20,7 @@ #include "include/api/status.h" #include "include/api/types.h" #include "minddata/dataset/core/tensor_shape.h" -#include "minddata/dataset/include/type_id.h" +#include "minddata/dataset/core/type_id.h" #include "utils/log_adapter.h" using mindspore::Status; From 4be0ffb9ba9c4afd01b771eae70c3be9307f92ae Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 16:51:10 -0400 Subject: [PATCH 03/10] removing type_id.h from header files --- .../ccsrc/minddata/dataset/api/datasets.cc | 3 + .../dataset/engine/ir/datasetops/bindings.cc | 1 + .../dataset/engine/ir/execute/bindings.cc | 1 + .../dataset/engine/ir/schema/bindings.cc | 3 +- .../dataset/api/python/pybind_conversion.h | 5 +- .../dataset/engine/opt/pre/deep_copy_pass.cc | 1 + .../engine/opt/pre/input_validation_pass.cc | 1 + .../ccsrc/minddata/dataset/include/datasets.h | 2 + .../ccsrc/minddata/dataset/include/type_id.h | 92 +++++++++++++++++++ tests/ut/cpp/dataset/common/common.h | 1 + 10 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 mindspore/ccsrc/minddata/dataset/include/type_id.h diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index 90e937c59a..180eba7507 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -19,9 +19,11 @@ #include #include #include +#include #include "minddata/dataset/core/tensor.h" #include "minddata/dataset/engine/runtime_context.h" +#include "minddata/dataset/include/iterator.h" #include "minddata/dataset/include/samplers.h" #include "minddata/dataset/include/transforms.h" #include "minddata/dataset/util/path.h" @@ -29,6 +31,7 @@ #include "minddata/dataset/core/client.h" #include "minddata/dataset/core/type_id.h" #include "minddata/dataset/engine/consumers/tree_consumer.h" +#include "minddata/dataset/engine/consumers/pull_based_tree_consumer.h" #include "minddata/dataset/kernels/c_func_op.h" #include "minddata/dataset/kernels/tensor_op.h" diff --git a/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/datasetops/bindings.cc b/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/datasetops/bindings.cc index 2b47a54d7c..d0aeb3f420 100644 --- a/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/datasetops/bindings.cc +++ b/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/datasetops/bindings.cc @@ -51,6 +51,7 @@ #include "minddata/dataset/core/config_manager.h" #include "minddata/dataset/core/data_type.h" +#include "minddata/dataset/core/type_id.h" #include "minddata/dataset/util/path.h" #include "minddata/dataset/util/random.h" #include "minddata/dataset/util/services.h" diff --git a/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/execute/bindings.cc b/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/execute/bindings.cc index 5d60d350db..c32b5d3c39 100644 --- a/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/execute/bindings.cc +++ b/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/execute/bindings.cc @@ -17,6 +17,7 @@ #include "minddata/dataset/api/python/pybind_conversion.h" #include "minddata/dataset/api/python/pybind_register.h" +#include "minddata/dataset/core/type_id.h" #include "minddata/dataset/include/execute.h" namespace mindspore { diff --git a/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/schema/bindings.cc b/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/schema/bindings.cc index 18691b9d3b..6a3c75bd31 100644 --- a/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/schema/bindings.cc +++ b/mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/engine/ir/schema/bindings.cc @@ -19,8 +19,9 @@ #include "minddata/dataset/api/python/pybind_register.h" #include "minddata/dataset/core/global_context.h" -#include "minddata/dataset/include/constants.h" #include "minddata/dataset/api/python/pybind_conversion.h" +#include "minddata/dataset/core/type_id.h" +#include "minddata/dataset/include/constants.h" #include "minddata/dataset/include/datasets.h" namespace mindspore { diff --git a/mindspore/ccsrc/minddata/dataset/api/python/pybind_conversion.h b/mindspore/ccsrc/minddata/dataset/api/python/pybind_conversion.h index a707ad241c..41ff949cdd 100644 --- a/mindspore/ccsrc/minddata/dataset/api/python/pybind_conversion.h +++ b/mindspore/ccsrc/minddata/dataset/api/python/pybind_conversion.h @@ -28,11 +28,12 @@ #include "pybind11/pybind11.h" #include "pybind11/stl.h" #include "pybind11/stl_bind.h" -#include "minddata/dataset/include/datasets.h" -#include "minddata/dataset/include/samplers.h" #include "minddata/dataset/api/python/pybind_register.h" +#include "minddata/dataset/core/type_id.h" #include "minddata/dataset/engine/ir/cache/pre_built_dataset_cache.h" #include "minddata/dataset/engine/ir/datasetops/source/csv_node.h" +#include "minddata/dataset/include/datasets.h" +#include "minddata/dataset/include/samplers.h" #include "minddata/dataset/kernels/ir/data/transforms_ir.h" #include "minddata/dataset/kernels/py_func_op.h" namespace py = pybind11; diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc index 459bb1d5fe..e6cf91094d 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/deep_copy_pass.cc @@ -15,6 +15,7 @@ */ #include +#include #include "minddata/dataset/include/datasets.h" #include "minddata/dataset/engine/opt/pre/deep_copy_pass.h" #include "minddata/dataset/engine/ir/datasetops/root_node.h" diff --git a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc index 3da5b15076..605aaf696f 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/opt/pre/input_validation_pass.cc @@ -15,6 +15,7 @@ */ #include +#include #include "minddata/dataset/include/datasets.h" #include "minddata/dataset/engine/opt/pre/input_validation_pass.h" diff --git a/mindspore/ccsrc/minddata/dataset/include/datasets.h b/mindspore/ccsrc/minddata/dataset/include/datasets.h index 6bffdd6a9c..4803991ee5 100644 --- a/mindspore/ccsrc/minddata/dataset/include/datasets.h +++ b/mindspore/ccsrc/minddata/dataset/include/datasets.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -51,6 +52,7 @@ class DatasetCache; class DatasetNode; class Iterator; +class PullBasedIterator; class TensorOperation; class SchemaObj; diff --git a/mindspore/ccsrc/minddata/dataset/include/type_id.h b/mindspore/ccsrc/minddata/dataset/include/type_id.h new file mode 100644 index 0000000000..ef077a832d --- /dev/null +++ b/mindspore/ccsrc/minddata/dataset/include/type_id.h @@ -0,0 +1,92 @@ +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_TYPEID_H_ +#define MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_TYPEID_H_ + +#include "mindspore/core/ir/dtype/type_id.h" +#include "minddata/dataset/core/data_type.h" + +namespace mindspore { +namespace dataset { +inline dataset::DataType MSTypeToDEType(TypeId data_type) { + switch (data_type) { + case kNumberTypeBool: + return dataset::DataType(dataset::DataType::DE_BOOL); + case kNumberTypeInt8: + return dataset::DataType(dataset::DataType::DE_INT8); + case kNumberTypeUInt8: + return dataset::DataType(dataset::DataType::DE_UINT8); + case kNumberTypeInt16: + return dataset::DataType(dataset::DataType::DE_INT16); + case kNumberTypeUInt16: + return dataset::DataType(dataset::DataType::DE_UINT16); + case kNumberTypeInt32: + return dataset::DataType(dataset::DataType::DE_INT32); + case kNumberTypeUInt32: + return dataset::DataType(dataset::DataType::DE_UINT32); + case kNumberTypeInt64: + return dataset::DataType(dataset::DataType::DE_INT64); + case kNumberTypeUInt64: + return dataset::DataType(dataset::DataType::DE_UINT64); + case kNumberTypeFloat16: + return dataset::DataType(dataset::DataType::DE_FLOAT16); + case kNumberTypeFloat32: + return dataset::DataType(dataset::DataType::DE_FLOAT32); + case kNumberTypeFloat64: + return dataset::DataType(dataset::DataType::DE_FLOAT64); + case kObjectTypeString: + return dataset::DataType(dataset::DataType::DE_STRING); + default: + return dataset::DataType(dataset::DataType::DE_UNKNOWN); + } +} + +inline TypeId DETypeToMSType(dataset::DataType data_type) { + switch (data_type.value()) { + case dataset::DataType::DE_BOOL: + return mindspore::TypeId::kNumberTypeBool; + case dataset::DataType::DE_INT8: + return mindspore::TypeId::kNumberTypeInt8; + case dataset::DataType::DE_UINT8: + return mindspore::TypeId::kNumberTypeUInt8; + case dataset::DataType::DE_INT16: + return mindspore::TypeId::kNumberTypeInt16; + case dataset::DataType::DE_UINT16: + return mindspore::TypeId::kNumberTypeUInt16; + case dataset::DataType::DE_INT32: + return mindspore::TypeId::kNumberTypeInt32; + case dataset::DataType::DE_UINT32: + return mindspore::TypeId::kNumberTypeUInt32; + case dataset::DataType::DE_INT64: + return mindspore::TypeId::kNumberTypeInt64; + case dataset::DataType::DE_UINT64: + return mindspore::TypeId::kNumberTypeUInt64; + case dataset::DataType::DE_FLOAT16: + return mindspore::TypeId::kNumberTypeFloat16; + case dataset::DataType::DE_FLOAT32: + return mindspore::TypeId::kNumberTypeFloat32; + case dataset::DataType::DE_FLOAT64: + return mindspore::TypeId::kNumberTypeFloat64; + case dataset::DataType::DE_STRING: + return mindspore::TypeId::kObjectTypeString; + default: + return kTypeUnknown; + } +} +} // namespace dataset +} // namespace mindspore + +#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_TYPEID_H_ diff --git a/tests/ut/cpp/dataset/common/common.h b/tests/ut/cpp/dataset/common/common.h index d99d17b13e..22e8bf3e73 100644 --- a/tests/ut/cpp/dataset/common/common.h +++ b/tests/ut/cpp/dataset/common/common.h @@ -21,6 +21,7 @@ #include "include/api/types.h" #include "minddata/dataset/core/tensor_shape.h" #include "minddata/dataset/core/type_id.h" +#include "minddata/dataset/core/de_tensor.h" #include "utils/log_adapter.h" using mindspore::Status; From e7ff0bd5605d3a78b49a304e4b0a67e3506175ce Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 17:17:25 -0400 Subject: [PATCH 04/10] Added json fix --- mindspore/ccsrc/minddata/dataset/api/datasets.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index 180eba7507..ca4d60ae54 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -14,12 +14,12 @@ * limitations under the License. */ +#include // we need this before the include to avoid ambiguity in nullptr conversion #include "minddata/dataset/include/datasets.h" #include #include #include #include -#include #include "minddata/dataset/core/tensor.h" #include "minddata/dataset/engine/runtime_context.h" From 4df7ba11bf26f8dbb79ab7c93ea766cc9050497f Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 17:20:13 -0400 Subject: [PATCH 05/10] Remove type_id.h --- .../ccsrc/minddata/dataset/include/type_id.h | 92 ------------------- 1 file changed, 92 deletions(-) delete mode 100644 mindspore/ccsrc/minddata/dataset/include/type_id.h diff --git a/mindspore/ccsrc/minddata/dataset/include/type_id.h b/mindspore/ccsrc/minddata/dataset/include/type_id.h deleted file mode 100644 index ef077a832d..0000000000 --- a/mindspore/ccsrc/minddata/dataset/include/type_id.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright 2020 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_TYPEID_H_ -#define MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_TYPEID_H_ - -#include "mindspore/core/ir/dtype/type_id.h" -#include "minddata/dataset/core/data_type.h" - -namespace mindspore { -namespace dataset { -inline dataset::DataType MSTypeToDEType(TypeId data_type) { - switch (data_type) { - case kNumberTypeBool: - return dataset::DataType(dataset::DataType::DE_BOOL); - case kNumberTypeInt8: - return dataset::DataType(dataset::DataType::DE_INT8); - case kNumberTypeUInt8: - return dataset::DataType(dataset::DataType::DE_UINT8); - case kNumberTypeInt16: - return dataset::DataType(dataset::DataType::DE_INT16); - case kNumberTypeUInt16: - return dataset::DataType(dataset::DataType::DE_UINT16); - case kNumberTypeInt32: - return dataset::DataType(dataset::DataType::DE_INT32); - case kNumberTypeUInt32: - return dataset::DataType(dataset::DataType::DE_UINT32); - case kNumberTypeInt64: - return dataset::DataType(dataset::DataType::DE_INT64); - case kNumberTypeUInt64: - return dataset::DataType(dataset::DataType::DE_UINT64); - case kNumberTypeFloat16: - return dataset::DataType(dataset::DataType::DE_FLOAT16); - case kNumberTypeFloat32: - return dataset::DataType(dataset::DataType::DE_FLOAT32); - case kNumberTypeFloat64: - return dataset::DataType(dataset::DataType::DE_FLOAT64); - case kObjectTypeString: - return dataset::DataType(dataset::DataType::DE_STRING); - default: - return dataset::DataType(dataset::DataType::DE_UNKNOWN); - } -} - -inline TypeId DETypeToMSType(dataset::DataType data_type) { - switch (data_type.value()) { - case dataset::DataType::DE_BOOL: - return mindspore::TypeId::kNumberTypeBool; - case dataset::DataType::DE_INT8: - return mindspore::TypeId::kNumberTypeInt8; - case dataset::DataType::DE_UINT8: - return mindspore::TypeId::kNumberTypeUInt8; - case dataset::DataType::DE_INT16: - return mindspore::TypeId::kNumberTypeInt16; - case dataset::DataType::DE_UINT16: - return mindspore::TypeId::kNumberTypeUInt16; - case dataset::DataType::DE_INT32: - return mindspore::TypeId::kNumberTypeInt32; - case dataset::DataType::DE_UINT32: - return mindspore::TypeId::kNumberTypeUInt32; - case dataset::DataType::DE_INT64: - return mindspore::TypeId::kNumberTypeInt64; - case dataset::DataType::DE_UINT64: - return mindspore::TypeId::kNumberTypeUInt64; - case dataset::DataType::DE_FLOAT16: - return mindspore::TypeId::kNumberTypeFloat16; - case dataset::DataType::DE_FLOAT32: - return mindspore::TypeId::kNumberTypeFloat32; - case dataset::DataType::DE_FLOAT64: - return mindspore::TypeId::kNumberTypeFloat64; - case dataset::DataType::DE_STRING: - return mindspore::TypeId::kObjectTypeString; - default: - return kTypeUnknown; - } -} -} // namespace dataset -} // namespace mindspore - -#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_TYPEID_H_ From 6a1e031846468999a6d0edf70c04fee0ac00f7bf Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 17:29:32 -0400 Subject: [PATCH 06/10] fix lint --- mindspore/ccsrc/minddata/dataset/api/datasets.cc | 2 +- mindspore/dataset/vision/c_transforms.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index ca4d60ae54..7281119910 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include // we need this before the include to avoid ambiguity in nullptr conversion #include "minddata/dataset/include/datasets.h" #include #include #include #include +#include // we need this before the include to avoid ambiguity in nullptr conversion #include "minddata/dataset/core/tensor.h" #include "minddata/dataset/engine/runtime_context.h" diff --git a/mindspore/dataset/vision/c_transforms.py b/mindspore/dataset/vision/c_transforms.py index 5ec0d6ce41..505435ae92 100644 --- a/mindspore/dataset/vision/c_transforms.py +++ b/mindspore/dataset/vision/c_transforms.py @@ -1126,6 +1126,8 @@ class RandomRotation(ImageTensorOperation): self.fill_value = fill_value def parse(self): + # pylint false positive + # pylint: disable=E1130 degrees = (-self.degrees, self.degrees) if isinstance(self.degrees, numbers.Number) else self.degrees interpolation = DE_C_INTER_MODE[self.resample] expand = self.expand From 62d4ef2b11cd9d1f396fb26672e5397cdb69ce43 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 17:36:59 -0400 Subject: [PATCH 07/10] fix build --- mindspore/ccsrc/minddata/dataset/core/ascend_resource.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/ccsrc/minddata/dataset/core/ascend_resource.cc b/mindspore/ccsrc/minddata/dataset/core/ascend_resource.cc index f8153b4b2b..274a91d9c1 100644 --- a/mindspore/ccsrc/minddata/dataset/core/ascend_resource.cc +++ b/mindspore/ccsrc/minddata/dataset/core/ascend_resource.cc @@ -16,8 +16,8 @@ #include "include/api/context.h" #include "include/api/types.h" -#include "minddata/dataset/include/type_id.h" #include "minddata/dataset/core/ascend_resource.h" +#include "minddata/dataset/core/type_id.h" #include "minddata/dataset/kernels/image/image_utils.h" namespace mindspore { From c730df23e87df4f3aa181547495933c918ba2758 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 18:32:42 -0400 Subject: [PATCH 08/10] Added json fix 2 --- .../ccsrc/minddata/dataset/api/datasets.cc | 26 +++++++++---------- .../ccsrc/minddata/dataset/include/datasets.h | 24 ++++++++--------- .../dataset/c_api_dataset_minddata_test.cc | 14 +++++----- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index 7281119910..f79af55815 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -19,7 +19,7 @@ #include #include #include -#include // we need this before the include to avoid ambiguity in nullptr conversion +#include #include "minddata/dataset/core/tensor.h" #include "minddata/dataset/engine/runtime_context.h" @@ -988,54 +988,54 @@ ManifestDataset::ManifestDataset(const std::vector &dataset_file, const st MindDataDataset::MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, - const std::shared_ptr &sampler, nlohmann::json padded_sample, + const std::shared_ptr &sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, - padded_sample, num_padded); + *padded_sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, Sampler *sampler, - nlohmann::json padded_sample, int64_t num_padded) { + nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, - padded_sample, num_padded); + *padded_sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, - const std::reference_wrapper sampler, nlohmann::json padded_sample, + const std::reference_wrapper sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler.get().Parse(); auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, - padded_sample, num_padded); + *padded_sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, - const std::shared_ptr &sampler, nlohmann::json padded_sample, + const std::shared_ptr &sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), - sampler_obj, padded_sample, num_padded); + sampler_obj, *padded_sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, Sampler *sampler, - nlohmann::json padded_sample, int64_t num_padded) { + nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), - sampler_obj, padded_sample, num_padded); + sampler_obj, *padded_sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, - const std::reference_wrapper sampler, nlohmann::json padded_sample, + const std::reference_wrapper sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler.get().Parse(); auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), - sampler_obj, padded_sample, num_padded); + sampler_obj, *padded_sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } #endif diff --git a/mindspore/ccsrc/minddata/dataset/include/datasets.h b/mindspore/ccsrc/minddata/dataset/include/datasets.h index 4803991ee5..a4d108fea7 100644 --- a/mindspore/ccsrc/minddata/dataset/include/datasets.h +++ b/mindspore/ccsrc/minddata/dataset/include/datasets.h @@ -1242,21 +1242,21 @@ inline std::shared_ptr Manifest(const std::string &dataset_file class MindDataDataset : public Dataset { public: explicit MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, - const std::shared_ptr &sampler, nlohmann::json padded_sample, int64_t num_padded); + const std::shared_ptr &sampler, nlohmann::json *padded_sample, int64_t num_padded); explicit MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, - Sampler *sampler, nlohmann::json padded_sample, int64_t num_padded); + Sampler *sampler, nlohmann::json *padded_sample, int64_t num_padded); explicit MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, - const std::reference_wrapper sampler, nlohmann::json padded_sample, + const std::reference_wrapper sampler, nlohmann::json *padded_sample, int64_t num_padded); explicit MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, const std::shared_ptr &sampler, - nlohmann::json padded_sample, int64_t num_padded); + nlohmann::json *padded_sample, int64_t num_padded); explicit MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, Sampler *sampler, - nlohmann::json padded_sample, int64_t num_padded); + nlohmann::json *padded_sample, int64_t num_padded); explicit MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, - const std::reference_wrapper sampler, nlohmann::json padded_sample, + const std::reference_wrapper sampler, nlohmann::json *padded_sample, int64_t num_padded); ~MindDataDataset() = default; }; @@ -1274,7 +1274,7 @@ class MindDataDataset : public Dataset { /// \return Shared pointer to the current MindDataDataset inline std::shared_ptr MindData( const std::string &dataset_file, const std::vector &columns_list = {}, - const std::shared_ptr &sampler = std::make_shared(), nlohmann::json padded_sample = nullptr, + const std::shared_ptr &sampler = std::make_shared(), nlohmann::json *padded_sample = nullptr, int64_t num_padded = 0) { return std::make_shared(StringToChar(dataset_file), VectorStringToChar(columns_list), sampler, padded_sample, num_padded); @@ -1291,7 +1291,7 @@ inline std::shared_ptr MindData( /// \return Shared pointer to the current MindDataDataset inline std::shared_ptr MindData(const std::string &dataset_file, const std::vector &columns_list, Sampler *sampler, - nlohmann::json padded_sample = nullptr, int64_t num_padded = 0) { + nlohmann::json *padded_sample = nullptr, int64_t num_padded = 0) { return std::make_shared(StringToChar(dataset_file), VectorStringToChar(columns_list), sampler, padded_sample, num_padded); } @@ -1308,7 +1308,7 @@ inline std::shared_ptr MindData(const std::string &dataset_file inline std::shared_ptr MindData(const std::string &dataset_file, const std::vector &columns_list, const std::reference_wrapper sampler, - nlohmann::json padded_sample = nullptr, int64_t num_padded = 0) { + nlohmann::json *padded_sample = nullptr, int64_t num_padded = 0) { return std::make_shared(StringToChar(dataset_file), VectorStringToChar(columns_list), sampler, padded_sample, num_padded); } @@ -1325,7 +1325,7 @@ inline std::shared_ptr MindData(const std::string &dataset_file /// \return Shared pointer to the current MindDataDataset inline std::shared_ptr MindData( const std::vector &dataset_files, const std::vector &columns_list = {}, - const std::shared_ptr &sampler = std::make_shared(), nlohmann::json padded_sample = nullptr, + const std::shared_ptr &sampler = std::make_shared(), nlohmann::json *padded_sample = nullptr, int64_t num_padded = 0) { return std::make_shared(VectorStringToChar(dataset_files), VectorStringToChar(columns_list), sampler, padded_sample, num_padded); @@ -1341,7 +1341,7 @@ inline std::shared_ptr MindData( /// \return Shared pointer to the current MindDataDataset inline std::shared_ptr MindData(const std::vector &dataset_files, const std::vector &columns_list, Sampler *sampler, - nlohmann::json padded_sample = nullptr, int64_t num_padded = 0) { + nlohmann::json *padded_sample = nullptr, int64_t num_padded = 0) { return std::make_shared(VectorStringToChar(dataset_files), VectorStringToChar(columns_list), sampler, padded_sample, num_padded); } @@ -1357,7 +1357,7 @@ inline std::shared_ptr MindData(const std::vector inline std::shared_ptr MindData(const std::vector &dataset_files, const std::vector &columns_list, const std::reference_wrapper sampler, - nlohmann::json padded_sample = nullptr, int64_t num_padded = 0) { + nlohmann::json *padded_sample = nullptr, int64_t num_padded = 0) { return std::make_shared(VectorStringToChar(dataset_files), VectorStringToChar(columns_list), sampler, padded_sample, num_padded); } diff --git a/tests/ut/cpp/dataset/c_api_dataset_minddata_test.cc b/tests/ut/cpp/dataset/c_api_dataset_minddata_test.cc index a63d73a104..ee60aa9184 100644 --- a/tests/ut/cpp/dataset/c_api_dataset_minddata_test.cc +++ b/tests/ut/cpp/dataset/c_api_dataset_minddata_test.cc @@ -289,7 +289,7 @@ TEST_F(MindDataTestPipeline, TestMindDataSuccess7) { std::string file_path1 = datasets_root_path_ + "/../mindrecord/testMindDataSet/testImageNetData/imagenet.mindrecord0"; std::vector file_list = {file_path1}; std::shared_ptr ds = - MindData(file_list, {"file_name", "label"}, std::make_shared(), pad, 4); + MindData(file_list, {"file_name", "label"}, std::make_shared(), &pad, 4); EXPECT_NE(ds, nullptr); // Create a Skip operation on ds, skip original data in mindrecord and get padded samples @@ -341,7 +341,7 @@ TEST_F(MindDataTestPipeline, TestMindDataSuccess8) { std::string file_path1 = datasets_root_path_ + "/../mindrecord/testMindDataSet/testImageNetData/imagenet.mindrecord0"; std::vector file_list = {file_path1}; std::shared_ptr ds = - MindData(file_list, {"file_name", "label"}, std::make_shared(), pad, 4); + MindData(file_list, {"file_name", "label"}, std::make_shared(), &pad, 4); EXPECT_NE(ds, nullptr); std::vector types = ToDETypes(ds->GetOutputTypes()); @@ -412,13 +412,13 @@ TEST_F(MindDataTestPipeline, TestMindDataSuccess9) { std::string file_path1 = datasets_root_path_ + "/../mindrecord/testMindDataSet/testImageNetData/imagenet.mindrecord0"; std::vector file_list = {file_path1}; std::shared_ptr ds1 = - MindData(file_list, {"file_name", "label"}, std::make_shared(), pad, 4); + MindData(file_list, {"file_name", "label"}, std::make_shared(), &pad, 4); EXPECT_NE(ds1, nullptr); ds1 = ds1->Skip(5); EXPECT_NE(ds1, nullptr); std::shared_ptr ds2 = - MindData(file_list, {"file_name", "label"}, std::make_shared(), pad, 4); + MindData(file_list, {"file_name", "label"}, std::make_shared(), &pad, 4); EXPECT_NE(ds2, nullptr); ds2 = ds2->Skip(5); EXPECT_NE(ds2, nullptr); @@ -588,7 +588,7 @@ TEST_F(MindDataTestPipeline, TestMindDataFail4) { // Create a MindData Dataset std::string file_path2 = datasets_root_path_ + "/../mindrecord/testMindDataSet/testImageNetData/imagenet.mindrecord0"; - std::shared_ptr ds2 = MindData(file_path2, {"label"}, std::make_shared(), pad, -2); + std::shared_ptr ds2 = MindData(file_path2, {"label"}, std::make_shared(), &pad, -2); EXPECT_NE(ds2, nullptr); // Create an iterator over the result of the above dataset @@ -598,7 +598,7 @@ TEST_F(MindDataTestPipeline, TestMindDataFail4) { // Create a MindData Dataset std::string file_path3 = datasets_root_path_ + "/../mindrecord/testMindDataSet/testImageNetData/imagenet.mindrecord0"; - std::shared_ptr ds3 = MindData(file_path3, {}, std::make_shared(), pad, 1); + std::shared_ptr ds3 = MindData(file_path3, {}, std::make_shared(), &pad, 1); EXPECT_NE(ds3, nullptr); // Create an iterator over the result of the above dataset @@ -614,7 +614,7 @@ TEST_F(MindDataTestPipeline, TestMindDataFail4) { // Create a MindData Dataset std::string file_path4 = datasets_root_path_ + "/../mindrecord/testMindDataSet/testImageNetData/imagenet.mindrecord0"; std::shared_ptr ds4 = - MindData(file_path4, {"file_name", "label"}, std::make_shared(), pad2, 1); + MindData(file_path4, {"file_name", "label"}, std::make_shared(), &pad2, 1); EXPECT_NE(ds4, nullptr); // Create an iterator over the result of the above dataset From 4e5b174f8ff9c39c5da0218fd89e8b46c4abf156 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 19:21:44 -0400 Subject: [PATCH 09/10] fix ut --- .../ccsrc/minddata/dataset/api/datasets.cc | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index f79af55815..d35a074c31 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -991,16 +991,24 @@ MindDataDataset::MindDataDataset(const std::vector &dataset_file, const std::shared_ptr &sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; + nlohmann::json sample = nullptr; + if (padded_sample) { + sample = *padded_sample; + }; auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, - *padded_sample, num_padded); + sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector &dataset_file, const std::vector> &columns_list, Sampler *sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; + nlohmann::json sample = nullptr; + if (padded_sample) { + sample = *padded_sample; + }; auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, - *padded_sample, num_padded); + sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector &dataset_file, @@ -1008,8 +1016,13 @@ MindDataDataset::MindDataDataset(const std::vector &dataset_file, const std::reference_wrapper sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler.get().Parse(); + nlohmann::json sample = nullptr; + if (padded_sample) { + sample = *padded_sample; + }; + auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, - *padded_sample, num_padded); + sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector> &dataset_files, @@ -1017,16 +1030,26 @@ MindDataDataset::MindDataDataset(const std::vector> &dataset_f const std::shared_ptr &sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; + nlohmann::json sample = nullptr; + if (padded_sample) { + sample = *padded_sample; + }; + auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), - sampler_obj, *padded_sample, num_padded); + sampler_obj, sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector> &dataset_files, const std::vector> &columns_list, Sampler *sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler ? sampler->Parse() : nullptr; + nlohmann::json sample = nullptr; + if (padded_sample) { + sample = *padded_sample; + }; + auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), - sampler_obj, *padded_sample, num_padded); + sampler_obj, sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } MindDataDataset::MindDataDataset(const std::vector> &dataset_files, @@ -1034,8 +1057,12 @@ MindDataDataset::MindDataDataset(const std::vector> &dataset_f const std::reference_wrapper sampler, nlohmann::json *padded_sample, int64_t num_padded) { auto sampler_obj = sampler.get().Parse(); + nlohmann::json sample = nullptr; + if (padded_sample) { + sample = *padded_sample; + }; auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), - sampler_obj, *padded_sample, num_padded); + sampler_obj, sample, num_padded); ir_node_ = std::static_pointer_cast(ds); } #endif From 3d38a50f56c59a12d040f382813ccb542410012e Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 16 Mar 2021 19:28:29 -0400 Subject: [PATCH 10/10] fix lint --- mindspore/ccsrc/minddata/dataset/api/datasets.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/api/datasets.cc b/mindspore/ccsrc/minddata/dataset/api/datasets.cc index d35a074c31..6e7f34844e 100644 --- a/mindspore/ccsrc/minddata/dataset/api/datasets.cc +++ b/mindspore/ccsrc/minddata/dataset/api/datasets.cc @@ -994,7 +994,7 @@ MindDataDataset::MindDataDataset(const std::vector &dataset_file, nlohmann::json sample = nullptr; if (padded_sample) { sample = *padded_sample; - }; + } auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, sample, num_padded); ir_node_ = std::static_pointer_cast(ds); @@ -1006,7 +1006,7 @@ MindDataDataset::MindDataDataset(const std::vector &dataset_file, nlohmann::json sample = nullptr; if (padded_sample) { sample = *padded_sample; - }; + } auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, sample, num_padded); ir_node_ = std::static_pointer_cast(ds); @@ -1019,7 +1019,7 @@ MindDataDataset::MindDataDataset(const std::vector &dataset_file, nlohmann::json sample = nullptr; if (padded_sample) { sample = *padded_sample; - }; + } auto ds = std::make_shared(CharToString(dataset_file), VectorCharToString(columns_list), sampler_obj, sample, num_padded); @@ -1033,7 +1033,7 @@ MindDataDataset::MindDataDataset(const std::vector> &dataset_f nlohmann::json sample = nullptr; if (padded_sample) { sample = *padded_sample; - }; + } auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), sampler_obj, sample, num_padded); @@ -1046,7 +1046,7 @@ MindDataDataset::MindDataDataset(const std::vector> &dataset_f nlohmann::json sample = nullptr; if (padded_sample) { sample = *padded_sample; - }; + } auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), sampler_obj, sample, num_padded); @@ -1060,7 +1060,7 @@ MindDataDataset::MindDataDataset(const std::vector> &dataset_f nlohmann::json sample = nullptr; if (padded_sample) { sample = *padded_sample; - }; + } auto ds = std::make_shared(VectorCharToString(dataset_files), VectorCharToString(columns_list), sampler_obj, sample, num_padded); ir_node_ = std::static_pointer_cast(ds);