Skip to content

Commit a835e03

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>() (#6322)
Summary: Pull Request resolved: #6322 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 fbshipit-source-id: baf2f18351ba97fb232dce61b1eb84ebb26216e4
1 parent 7510f8c commit a835e03

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

backends/cadence/reference/operators/dequantize_per_tensor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ 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(
46+
false,
47+
"Unhandled input dtype %hhd",
48+
static_cast<int8_t>(input.scalar_type()));
4649
}
4750
}
4851

backends/cadence/reference/operators/quantize_per_tensor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ 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(
48+
false,
49+
"Unhandled input dtype %hhd",
50+
static_cast<int8_t>(out.scalar_type()));
4851
}
4952
}
5053

backends/cadence/reference/operators/quantized_layer_norm.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ 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(
149+
false,
150+
"Unhandled input dtype %hhd",
151+
static_cast<int8_t>(input.scalar_type()));
149152
}
150153
}
151154

backends/cadence/reference/operators/quantized_relu_out.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ 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(
72+
false,
73+
"Unhandled input dtype %hhd",
74+
static_cast<int8_t>(input.scalar_type()));
7275
}
7376
}
7477

0 commit comments

Comments
 (0)