Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion onnxruntime/core/framework/onnxruntime_typeinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ OrtStatus* OrtTypeInfo::FromDataTypeImpl(const onnxruntime::DataTypeImpl* input,
return OrtCreateStatus(ORT_NOT_IMPLEMENTED, "not implemented");
}

const DataTypeImpl* ElementTypeFromProto(ONNX_NAMESPACE::TensorProto_DataType type) {
const DataTypeImpl* ElementTypeFromProto(int type) {
switch (type) {
case ONNX_NAMESPACE::TensorProto_DataType_FLOAT:
return DataTypeImpl::GetType<float>();
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/graph/contrib_ops/range_schema_defs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static int64_t CalcRangeDim(const TensorProto* startShapeInitializer,
static int64_t CalcResultDim(const TensorProto* startShapeInitializer,
const TensorProto* limitShapeInitializer,
const TensorProto* deltaShapeInitializer,
TensorProto_DataType dtype) {
int dtype) {
int64_t dim = -1LL;
if (dtype == TensorProto::FLOAT) {
dim = CalcRangeDim<float>(startShapeInitializer, limitShapeInitializer, deltaShapeInitializer);
Expand Down Expand Up @@ -146,7 +146,7 @@ OpSchema& RegisterRangeOpSchema(OpSchema&& op_schema){
const TensorProto* limitShapeInitializer = ctx.getInputData(1);
const TensorProto* deltaShapeInitializer = (ctx.getNumInputs() > 2) ? ctx.getInputData(2) : nullptr;
const auto& startTensorType = ctx.getInputType(0)->tensor_type();
TensorProto_DataType dtype = startTensorType.elem_type();
int dtype = startTensorType.elem_type();

int64_t n = CalcResultDim(startShapeInitializer, limitShapeInitializer, deltaShapeInitializer, dtype);
dim.set_dim_value(n);
Expand Down
8 changes: 4 additions & 4 deletions onnxruntime/core/graph/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ common::Status NodeArg::UpdateTypeAndShape(const ONNX_NAMESPACE::TypeProto& inpu

if (input_tensor_elem_type != current_tensor_elem_type)
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "Tensor element type mismatch. ",
TensorProto_DataType_Name(input_tensor_elem_type), " != ",
TensorProto_DataType_Name(current_tensor_elem_type));
TensorProto_DataType_Name(static_cast<TensorProto_DataType>(input_tensor_elem_type)), " != ",
TensorProto_DataType_Name(static_cast<TensorProto_DataType>(current_tensor_elem_type)));

if (input_tensor_type.has_shape()) {
auto& current_tensor_type = *current_type.mutable_tensor_type();
Expand All @@ -172,8 +172,8 @@ common::Status NodeArg::UpdateTypeAndShape(const ONNX_NAMESPACE::TypeProto& inpu
const auto current_tensor_elem_type = current_type.sparse_tensor_type().elem_type();
if (input_tensor_elem_type != current_tensor_elem_type) {
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "SparseTensor element type mismatch. ",
TensorProto_DataType_Name(input_tensor_elem_type), " != ",
TensorProto_DataType_Name(current_tensor_elem_type));
TensorProto_DataType_Name(static_cast<TensorProto_DataType>(input_tensor_elem_type)), " != ",
TensorProto_DataType_Name(static_cast<TensorProto_DataType>(current_tensor_elem_type)));
}
if (input_tensor_type.has_shape()) {
auto& current_tensor_type = *current_type.mutable_sparse_tensor_type();
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/core/graph/initializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ class Initializer final {
}
}

ONNX_NAMESPACE::TensorProto_DataType data_type() const {
int data_type() const {
return data_type_;
}

ONNX_NAMESPACE::TensorProto_DataType& data_type() {
int& data_type() {
return data_type_;
}

Expand Down Expand Up @@ -372,7 +372,7 @@ class Initializer final {
}

private:
ONNX_NAMESPACE::TensorProto_DataType data_type_;
int data_type_;
std::string name_;
std::vector<int64_t> dims_;
int64_t size_;
Expand Down
14 changes: 7 additions & 7 deletions onnxruntime/core/protobuf/onnx-ml.proto
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ message TensorProto {
repeated int64 dims = 1;

// The data type of the tensor.
optional DataType data_type = 2;
optional int32 data_type = 2;

// For very large tensors, we may want to store them in chunks, in which
// case the following fields will specify the segment that is stored in
Expand Down Expand Up @@ -438,7 +438,7 @@ message TypeProto {
message Tensor {
// This field MUST NOT have the value of UNDEFINED
// This field MUST be present for this version of the IR.
optional TensorProto.DataType elem_type = 1;
optional int32 elem_type = 1;
optional TensorShapeProto shape = 2;
}

Expand All @@ -454,7 +454,7 @@ message TypeProto {
message Map {
// This field MUST be present for this version of the IR.
// This field MUST refer to an integral type ([U]INT{8|16|32|64}) or STRING
optional TensorProto.DataType key_type = 1;
optional int32 key_type = 1;
// This field MUST be present for this version of the IR.
optional TypeProto value_type = 2;
};
Expand All @@ -469,10 +469,10 @@ message TypeProto {
// repeated TypeProto parameters = 3;
}

message SparseTensor {
// This field MUST NOT have the value of UNDEFINED
// This field MUST be present for this version of the IR.
optional TensorProto.DataType elem_type = 1;
message SparseTensor {
// This field MUST NOT have the value of UNDEFINED
// This field MUST be present for this version of the IR.
optional int32 elem_type = 1;
optional TensorShapeProto shape = 2;
}

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/test/util/compare_mlvalue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace onnxruntime;

namespace {

ONNXTensorElementDataType CApiElementTypeFromProto(ONNX_NAMESPACE::TensorProto_DataType type) {
ONNXTensorElementDataType CApiElementTypeFromProto(int type) {
switch (type) {
CASE_TYPE(FLOAT)
CASE_TYPE(UINT8)
Expand Down
4 changes: 2 additions & 2 deletions tools/ci_build/github/linux/docker/scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ else
#Install ONNX
#5af210ca8a1c73aa6bae8754c9346ec54d0a756e is v1.2.3
#bae6333e149a59a3faa9c4d9c44974373dcf5256 is v1.3.0
#0a4d5abdf4939ab0842a5eadcc16a3bf0738f901 is v1.3.0 latest
for onnx_version in "5af210ca8a1c73aa6bae8754c9346ec54d0a756e" "bae6333e149a59a3faa9c4d9c44974373dcf5256" "0a4d5abdf4939ab0842a5eadcc16a3bf0738f901"; do
#0c8d857bb162431912b255d5c0e773fb7c131a65 is v1.3.0 latest
for onnx_version in "5af210ca8a1c73aa6bae8754c9346ec54d0a756e" "bae6333e149a59a3faa9c4d9c44974373dcf5256" "0c8d857bb162431912b255d5c0e773fb7c131a65"; do
if [ -z ${lastest_onnx_version+x} ]; then
echo "first pass";
else
Expand Down