@@ -79,7 +79,7 @@ ov::Tensor padding_336(const ov::Tensor& unpadded) {
79
79
ov::Tensor padded{ov::element::u8, {1 , s1, tar, 3 }};
80
80
uint8_t * padded_data = padded.data <uint8_t >();
81
81
std::fill_n (padded_data, padded.get_size (), 255 );
82
- uint8_t * unpadded_data = unpadded.data <uint8_t >();
82
+ auto unpadded_data = unpadded.data <uint8_t >();
83
83
for (size_t row = 0 ; row < s1; ++row) {
84
84
std::copy_n (unpadded_data + row * s2 * 3 , s2 * 3 , padded_data + row * tar * 3 + left_padding * 3 );
85
85
}
@@ -103,7 +103,7 @@ ov::Tensor HD_transform(const ov::Tensor& uint8, size_t num_crops) {
103
103
size_t new_w = scale * INPUT_IMAGE_SIZE;
104
104
size_t new_h = new_w / ratio;
105
105
clip_image_u8 src{}, dst{};
106
- uint8_t * uint8_data = uint8.data <uint8_t >();
106
+ auto uint8_data = uint8.data <uint8_t >();
107
107
if (trans) {
108
108
src = clip_image_u8{int (height), int (width), {uint8_data, uint8_data + uint8.get_size ()}};
109
109
bilinear_resize (src, dst, new_h, new_w);
@@ -115,7 +115,7 @@ ov::Tensor HD_transform(const ov::Tensor& uint8, size_t num_crops) {
115
115
}
116
116
117
117
ov::Tensor mean_scale (const ov::Tensor& uint8, const ProcessorConfig& config) {
118
- uint8_t * uint_8_data = uint8.data <uint8_t >();
118
+ auto uint_8_data = uint8.data <uint8_t >();
119
119
ov::Tensor float_normalized{ov::element::f32, uint8.get_shape ()};
120
120
float * float_data = float_normalized.data <float >();
121
121
OPENVINO_ASSERT (0 == uint8.get_size () % 3 , " RGB" );
@@ -130,7 +130,7 @@ ov::Tensor mean_scale(const ov::Tensor& uint8, const ProcessorConfig& config) {
130
130
ov::Tensor channels_first (const ov::Tensor& _1hw3) {
131
131
ov::Shape shape = _1hw3.get_shape ();
132
132
ov::Tensor _13hw = ov::Tensor{ov::element::f32, {1 , 3 , shape.at (1 ), shape.at (2 )}};
133
- float * _1hw3_data = _1hw3.data <float >();
133
+ auto _1hw3_data = _1hw3.data <float >();
134
134
float * _13hw_data = _13hw.data <float >();
135
135
for (size_t plane = 0 ; plane < 3 ; ++plane) {
136
136
for (size_t row = 0 ; row < shape.at (1 ); ++row) {
@@ -156,7 +156,7 @@ ov::Tensor slice_image(const ov::Tensor& image) {
156
156
// Step 1: Define and populate the reshaped tensor in the correct shape order
157
157
ov::Tensor reshaped{ov::element::f32, {N, num_h_slices, num_w_slices, C, INPUT_IMAGE_SIZE, INPUT_IMAGE_SIZE}};
158
158
float * reshaped_data = reshaped.data <float >();
159
- float * image_data = image.data <float >();
159
+ auto image_data = image.data <float >();
160
160
161
161
// Populate the reshaped tensor
162
162
for (size_t n = 0 ; n < N; ++n) {
@@ -217,8 +217,8 @@ ov::Tensor concatenate_batch(const ov::Tensor& float_first, const ov::Tensor& fl
217
217
OPENVINO_ASSERT (shape_first.at (3 ) == shape_second.at (3 ), " Width must be the same" );
218
218
ov::Tensor concatenated{ov::element::f32, {shape_first.at (0 ) + shape_second.at (0 ), shape_first.at (1 ), shape_first.at (2 ), shape_first.at (3 )}};
219
219
float * concatenated_data = concatenated.data <float >();
220
- float * first_data = float_first.data <float >();
221
- float * second_data = float_second.data <float >();
220
+ auto first_data = float_first.data <float >();
221
+ auto second_data = float_second.data <float >();
222
222
std::copy (first_data, first_data + float_first.get_size (), concatenated_data);
223
223
std::copy (second_data, second_data + float_second.get_size (), concatenated_data + float_first.get_size ());
224
224
return concatenated;
@@ -232,7 +232,7 @@ ov::Tensor pad_to_max_num_crops_tensor(const ov::Tensor& nchw, size_t max_crops)
232
232
}
233
233
ov::Tensor padded{ov::element::f32, {max_crops, shape[1 ], shape[2 ], shape[3 ]}};
234
234
float * padded_data = padded.data <float >();
235
- float * nchw_data = nchw.data <float >();
235
+ auto nchw_data = nchw.data <float >();
236
236
std::copy_n (nchw_data, nchw.get_size (), padded_data);
237
237
return padded;
238
238
}
0 commit comments