File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
kernels/portable/cpu/util Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -213,13 +213,15 @@ ET_NODISCARD Error get_broadcast_target_size(
213
213
Tensor::SizesType* out_sizes,
214
214
const size_t out_sizes_len,
215
215
size_t * out_dim) {
216
- if (!tensors_are_broadcastable_between (a_size, b_size)) {
216
+ if ET_UNLIKELY (!tensors_are_broadcastable_between (a_size, b_size)) {
217
+ #ifdef ET_LOG_ENABLED
217
218
const auto a_shape_str = tensor_shape_to_c_string (
218
219
executorch::runtime::Span<const Tensor::SizesType>(
219
220
a_size.data (), a_size.size ()));
220
221
const auto b_shape_str = tensor_shape_to_c_string (
221
222
executorch::runtime::Span<const Tensor::SizesType>(
222
223
b_size.data (), b_size.size ()));
224
+ #endif
223
225
ET_LOG (
224
226
Error,
225
227
" Two input tensors should be broadcastable but got shapes %s and %s." ,
You can’t perform that action at this time.
0 commit comments