mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-26 03:00:54 +00:00
replace onnx:: with ONNX_NAMESPACE:: (#1376)
* replace onnx:: with ONNX_NAMESPACE:: * Fixed issue for building shared libs * address CR feedback * address more CR feedback
This commit is contained in:
parent
61b733ce6d
commit
fa4b956f12
5 changed files with 5 additions and 7 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue