diff --git a/js/react_native/ios/OnnxruntimeModuleTest/OnnxruntimeModuleTest.mm b/js/react_native/ios/OnnxruntimeModuleTest/OnnxruntimeModuleTest.mm index 03aa40bcc3..13341cb115 100644 --- a/js/react_native/ios/OnnxruntimeModuleTest/OnnxruntimeModuleTest.mm +++ b/js/react_native/ios/OnnxruntimeModuleTest/OnnxruntimeModuleTest.mm @@ -68,10 +68,10 @@ FakeRCTBlobManager *fakeBlobManager = nil; inputTensorMap[@"type"] = JsTensorTypeFloat; // data - std::array outValues{std::numeric_limits::min(), 1.0f, -2.0f, 3.0f, - std::numeric_limits::max()}; + std::array outValues{std::numeric_limits::min(), 1.0f, -2.0f, 3.0f, + std::numeric_limits::max()}; - const NSInteger byteBufferSize = outValues.size() * sizeof(float_t); + const NSInteger byteBufferSize = outValues.size() * sizeof(float); unsigned char *byteBuffer = static_cast(malloc(byteBufferSize)); NSData *byteBufferRef = [NSData dataWithBytesNoCopy:byteBuffer length:byteBufferSize]; float *floatPtr = (float *)[byteBufferRef bytes]; diff --git a/js/react_native/ios/OnnxruntimeModuleTest/TensorHelperTest.mm b/js/react_native/ios/OnnxruntimeModuleTest/TensorHelperTest.mm index 42e903a9b4..edd476d039 100644 --- a/js/react_native/ios/OnnxruntimeModuleTest/TensorHelperTest.mm +++ b/js/react_native/ios/OnnxruntimeModuleTest/TensorHelperTest.mm @@ -66,9 +66,9 @@ static void testCreateInputTensorT(const std::array &outValues, std::funct } - (void)testCreateInputTensorFloat { - std::array outValues{std::numeric_limits::min(), 2.0f, std::numeric_limits::max()}; - std::function convert = [](float_t value) { return [NSNumber numberWithFloat:value]; }; - testCreateInputTensorT(outValues, convert, ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT, JsTensorTypeFloat); + std::array outValues{std::numeric_limits::min(), 2.0f, std::numeric_limits::max()}; + std::function convert = [](float value) { return [NSNumber numberWithFloat:value]; }; + testCreateInputTensorT(outValues, convert, ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT, JsTensorTypeFloat); } - (void)testCreateInputTensorDouble { @@ -241,10 +241,10 @@ static void testCreateOutputTensorT(const std::array &outValues, std::func } - (void)testCreateOutputTensorFloat { - std::array outValues{std::numeric_limits::min(), 1.0f, 2.0f, 3.0f, - std::numeric_limits::max()}; - std::function convert = [](float_t value) { return [NSNumber numberWithFloat:value]; }; - testCreateOutputTensorT(outValues, convert, JsTensorTypeFloat, @"test_types_float", @"ort"); + std::array outValues{std::numeric_limits::min(), 1.0f, 2.0f, 3.0f, + std::numeric_limits::max()}; + std::function convert = [](float value) { return [NSNumber numberWithFloat:value]; }; + testCreateOutputTensorT(outValues, convert, JsTensorTypeFloat, @"test_types_float", @"ort"); } - (void)testCreateOutputTensorDouble { diff --git a/js/react_native/ios/TensorHelper.mm b/js/react_native/ios/TensorHelper.mm index 1d6a3a3b79..8555dfec27 100644 --- a/js/react_native/ios/TensorHelper.mm +++ b/js/react_native/ios/TensorHelper.mm @@ -148,7 +148,7 @@ static Ort::Value createInputTensorT(OrtAllocator *ortAllocator, const std::vect allocations:(std::vector &)allocations { switch (tensorType) { case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT: - return createInputTensorT(ortAllocator, dims, buffer, allocations); + return createInputTensorT(ortAllocator, dims, buffer, allocations); case ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8: return createInputTensorT(ortAllocator, dims, buffer, allocations); case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8: @@ -193,7 +193,7 @@ template static NSData *createOutputTensorT(const Ort::Value &tenso switch (tensorType) { case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT: - return createOutputTensorT(tensor); + return createOutputTensorT(tensor); case ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8: return createOutputTensorT(tensor); case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8: diff --git a/onnxruntime/core/optimizer/attention_fusion_helper.h b/onnxruntime/core/optimizer/attention_fusion_helper.h index 2aeda6137c..6233e5b839 100644 --- a/onnxruntime/core/optimizer/attention_fusion_helper.h +++ b/onnxruntime/core/optimizer/attention_fusion_helper.h @@ -345,7 +345,7 @@ bool ValidateUnidirMask(const Graph& graph, const NodeArg& mask, bool& is_unidir return false; } } else if (tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_FLOAT) { - std::vector float_data = ONNX_NAMESPACE::ParseData(tensor_proto); + std::vector float_data = ONNX_NAMESPACE::ParseData(tensor_proto); if (!ValidateUnidirMask(float_data, shape->dim(2).dim_value(), is_unidirectional)) { DEBUG_LOG("Mask is neither unidirectional nor all ones"); return false; diff --git a/onnxruntime/core/providers/cpu/tensor/upsample.cc b/onnxruntime/core/providers/cpu/tensor/upsample.cc index c54e5b61f6..fa69e144be 100644 --- a/onnxruntime/core/providers/cpu/tensor/upsample.cc +++ b/onnxruntime/core/providers/cpu/tensor/upsample.cc @@ -670,7 +670,7 @@ static TrilinearParams SetupUpsampleTrilinear(int64_t input_depth, // pixel value in the output // (cache because we don't have to re-compute each time we come across the output width/output height value // while iterating the output image tensor - SafeInt scale_buffer_size = SafeInt(2) * sizeof(float_t) * + SafeInt scale_buffer_size = SafeInt(2) * sizeof(float) * (output_depth + output_height + output_width); // Limit number of allocations to just 1