forked from mindspore-Ecosystem/mindspore
removing type_id.h from header files
This commit is contained in:
parent
9b921953f9
commit
4be0ffb9ba
|
@ -19,9 +19,11 @@
|
|||
#include <fstream>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
#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"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "minddata/dataset/include/datasets.h"
|
||||
#include "minddata/dataset/engine/opt/pre/input_validation_pass.h"
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
@ -51,6 +52,7 @@ class DatasetCache;
|
|||
class DatasetNode;
|
||||
|
||||
class Iterator;
|
||||
class PullBasedIterator;
|
||||
|
||||
class TensorOperation;
|
||||
class SchemaObj;
|
||||
|
|
|
@ -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_
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue