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(
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." ,
You can’t perform that action at this time.
0 commit comments