diff --git a/src/nnfusion/frontend/onnx_import/util/util.hpp b/src/nnfusion/frontend/onnx_import/util/util.hpp index 21c82e078..23a136f01 100644 --- a/src/nnfusion/frontend/onnx_import/util/util.hpp +++ b/src/nnfusion/frontend/onnx_import/util/util.hpp @@ -148,52 +148,7 @@ namespace nnfusion if (tensor.has_raw_data()) { return __get_raw_data(tensor.raw_data()); - }else{ - NNFUSION_LOG(NNFUSION_WARNING) << "Have no raw data" << endl ; } - - if (tensor.data_type() == onnx::TensorProto_DataType_FLOAT16) - { - nnfusion::Shape shape{std::begin(tensor.dims()), std::end(tensor.dims())}; - size_t num_element = shape_size(shape); - std::vector raw_data = __get_data(tensor.int32_data()); - std::vector ret((num_element + 1) / 2); - uint32_t* src_p = (uint32_t*)raw_data.data(); - uint16_t* dst_p = (uint16_t*)ret.data(); - for (size_t i = 0; i < num_element; i++) - { - NNFUSION_CHECK((src_p[i] & 0xFFFF0000) == 0); - dst_p[i] = src_p[i] & 0x0000FFFF; - } - if (num_element % 2 == 1) - { - dst_p[num_element] = 0; - } - - return ret; - } - if (tensor.data_type() == onnx::TensorProto_DataType_FLOAT) - { - return __get_data(tensor.float_data()); - } - if (tensor.data_type() == onnx::TensorProto_DataType_INT32) - { - return __get_data(tensor.int32_data()); - } - if (tensor.data_type() == onnx::TensorProto_DataType_INT64) - { - return __get_data(tensor.int64_data()); - } - if (tensor.data_type() == onnx::TensorProto_DataType_UINT64) - { - return __get_data(tensor.uint64_data()); - } - NNFUSION_CHECK_FAIL() - << "invalid data type: " - << onnx::TensorProto_DataType_Name( - static_cast(tensor.data_type())); - return std::vector(); - } template <>