Skip to content

Commit dd7710c

Browse files
Jim Meyeringfacebook-github-bot
authored andcommitted
executorch/backends/cadence/reference/operators/quantized_layer_norm.cpp: fix a few format mismatches via static_cast<int>() (pytorch#6322)
Summary: Avoids a few errors like the following: executorch/backends/cadence/reference/operators/quantize_per_tensor.cpp:47:55: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] Reviewed By: tarun292, zonglinpeng, mcremon-meta Differential Revision: D64519629
1 parent ab628cc commit dd7710c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

backends/cadence/reference/operators/dequantize_per_tensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void dequantize_per_tensor_out(
4242
impl::reference::kernels::dequantize<int32_t>(
4343
out_data, input_data, scale, zero_point, numel);
4444
} else {
45-
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", input.scalar_type());
45+
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", static_cast<int8_t>(input.scalar_type()));
4646
}
4747
}
4848

backends/cadence/reference/operators/quantize_per_tensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void quantize_per_tensor_out(
4444
impl::reference::kernels::quantize<int32_t>(
4545
out_data, input_data, 1. / scale, zero_point, numel);
4646
} else {
47-
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", out.scalar_type());
47+
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", static_cast<int8_t>(out.scalar_type()));
4848
}
4949
}
5050

backends/cadence/reference/operators/quantized_layer_norm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void quantized_layer_norm_out(
145145
output_zero_point,
146146
out);
147147
} else {
148-
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", input.scalar_type());
148+
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", static_cast<int8_t>(input.scalar_type()));
149149
}
150150
}
151151

backends/cadence/reference/operators/quantized_relu_out.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void quantized_relu_out(
6868
out_shift,
6969
output);
7070
} else {
71-
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", input.scalar_type());
71+
ET_CHECK_MSG(false, "Unhandled input dtype %hhd", static_cast<int8_t>(input.scalar_type()));
7272
}
7373
}
7474

0 commit comments

Comments
 (0)