Skip to content

Commit f2538df

Browse files
committed
Update
[ghstack-poisoned]
1 parent 6420fa8 commit f2538df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernels/portable/cpu/util/broadcast_util.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,15 @@ ET_NODISCARD Error get_broadcast_target_size(
213213
Tensor::SizesType* out_sizes,
214214
const size_t out_sizes_len,
215215
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
217218
const auto a_shape_str = tensor_shape_to_c_string(
218219
executorch::runtime::Span<const Tensor::SizesType>(
219220
a_size.data(), a_size.size()));
220221
const auto b_shape_str = tensor_shape_to_c_string(
221222
executorch::runtime::Span<const Tensor::SizesType>(
222223
b_size.data(), b_size.size()));
224+
#endif
223225
ET_LOG(
224226
Error,
225227
"Two input tensors should be broadcastable but got shapes %s and %s.",

0 commit comments

Comments
 (0)