We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6420fa8 commit f2538dfCopy full SHA for f2538df
kernels/portable/cpu/util/broadcast_util.cpp
@@ -213,13 +213,15 @@ ET_NODISCARD Error get_broadcast_target_size(
213
Tensor::SizesType* out_sizes,
214
const size_t out_sizes_len,
215
size_t* out_dim) {
216
- if (!tensors_are_broadcastable_between(a_size, b_size)) {
+ if ET_UNLIKELY (!tensors_are_broadcastable_between(a_size, b_size)) {
217
+#ifdef ET_LOG_ENABLED
218
const auto a_shape_str = tensor_shape_to_c_string(
219
executorch::runtime::Span<const Tensor::SizesType>(
220
a_size.data(), a_size.size()));
221
const auto b_shape_str = tensor_shape_to_c_string(
222
223
b_size.data(), b_size.size()));
224
+#endif
225
ET_LOG(
226
Error,
227
"Two input tensors should be broadcastable but got shapes %s and %s.",
0 commit comments