diff --git a/onnxruntime/core/framework/tensorprotoutils.cc b/onnxruntime/core/framework/tensorprotoutils.cc index 4b4a661fdf..89726f5a4c 100644 --- a/onnxruntime/core/framework/tensorprotoutils.cc +++ b/onnxruntime/core/framework/tensorprotoutils.cc @@ -538,7 +538,7 @@ TensorProto::DataType GetTensorProtoType(const Tensor& tensor) { } ONNX_NAMESPACE::TensorProto TensorToTensorProto(const Tensor& tensor, const std::string& tensor_proto_name, - const onnx::TypeProto& tensor_proto_type) { + const ONNX_NAMESPACE::TypeProto& tensor_proto_type) { // Given we are using the raw_data field in the protobuf, this will work only for little-endian format. ORT_ENFORCE(IsLittleEndianOrder()); diff --git a/onnxruntime/core/framework/tensorprotoutils.h b/onnxruntime/core/framework/tensorprotoutils.h index 6be46a8a06..15d70f35ed 100644 --- a/onnxruntime/core/framework/tensorprotoutils.h +++ b/onnxruntime/core/framework/tensorprotoutils.h @@ -47,7 +47,7 @@ ONNX_NAMESPACE::TensorProto::DataType GetTensorProtoType(const Tensor& tensor); TODO Once the GetTensorProtoType supports all data types, we can remove the tensor_proto_type parameter and instead get the type from the tensor. */ ONNX_NAMESPACE::TensorProto TensorToTensorProto(const Tensor& tensor, const std::string& tensor_proto_name, - const onnx::TypeProto& tensor_proto_type); + const ONNX_NAMESPACE::TypeProto& tensor_proto_type); ONNXTensorElementDataType CApiElementTypeFromProtoType(int type); ONNXTensorElementDataType GetTensorElementType(const ONNX_NAMESPACE::TensorProto& tensor_proto); diff --git a/onnxruntime/core/graph/graph_utils.cc b/onnxruntime/core/graph/graph_utils.cc index 15d2613b99..2ac2a15303 100644 --- a/onnxruntime/core/graph/graph_utils.cc +++ b/onnxruntime/core/graph/graph_utils.cc @@ -398,7 +398,7 @@ const ONNX_NAMESPACE::TensorProto* GetConstantInitializer(const Graph& graph, co } bool IsConstantInitializer(const Graph& graph, const std::string& initializer_name, bool check_outer_scope) { - const onnx::TensorProto* initializer = GetConstantInitializer(graph, initializer_name, check_outer_scope); + const ONNX_NAMESPACE::TensorProto* initializer = GetConstantInitializer(graph, initializer_name, check_outer_scope); return initializer != nullptr; } diff --git a/onnxruntime/test/optimizer/optimizer_test.cc b/onnxruntime/test/optimizer/optimizer_test.cc index fce027650f..b8422cd1d9 100644 --- a/onnxruntime/test/optimizer/optimizer_test.cc +++ b/onnxruntime/test/optimizer/optimizer_test.cc @@ -20,8 +20,6 @@ using namespace std; using namespace ONNX_NAMESPACE; -using namespace onnx; - namespace onnxruntime { namespace test { @@ -48,7 +46,7 @@ TEST(OptimizerTest, Basic) { initializer_tensor[i].set_name(inputs[i]->Name()); initializer_tensor[i].add_dims(tensor_dim); - initializer_tensor[i].set_data_type(onnx::TensorProto_DataType_INT32); + initializer_tensor[i].set_data_type(ONNX_NAMESPACE::TensorProto_DataType_INT32); for (int j = 0; j < tensor_dim; j++) { initializer_tensor[i].add_int32_data((i + 1) * j); } diff --git a/onnxruntime/test/providers/memcpy_test.cc b/onnxruntime/test/providers/memcpy_test.cc index e502a02724..c43779875f 100644 --- a/onnxruntime/test/providers/memcpy_test.cc +++ b/onnxruntime/test/providers/memcpy_test.cc @@ -31,7 +31,7 @@ TEST(MemcpyTest, copy1) { KernelRegistryManager kernel_registry_manager; kernel_registry_manager.RegisterKernels(execution_providers); - onnx::ModelProto mp; + ONNX_NAMESPACE::ModelProto mp; std::ifstream model_istream("testdata/matmul_1.onnx", std::ifstream::in | std::ifstream::binary); google::protobuf::io::IstreamInputStream zero_copy_input(&model_istream); const bool result = mp.ParseFromZeroCopyStream(&zero_copy_input) && model_istream.eof();