Skip to content

Commit

Permalink
Ignore UB on multiply (pytorch#84665)
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: pytorch#84665
Approved by: https://github.com/Chillee
  • Loading branch information
ezyang authored and pytorchmergebot committed Sep 8, 2022
1 parent 1a1bcc7 commit 9669e3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aten/src/ATen/native/cpu/BinaryOpsKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void mul_kernel(TensorIteratorBase& iter) {
} else {
AT_DISPATCH_ALL_TYPES_AND_COMPLEX_AND2(kBFloat16, kHalf, iter.dtype(), "mul_cpu", [&]() {
cpu_kernel_vec(iter,
[=](scalar_t a, scalar_t b) -> scalar_t { return a * b; },
[=](Vectorized<scalar_t> a, Vectorized<scalar_t> b) {
[=](scalar_t a, scalar_t b) __ubsan_ignore_undefined__ -> scalar_t { return a * b; },
[=](Vectorized<scalar_t> a, Vectorized<scalar_t> b) __ubsan_ignore_undefined__ {
return a * b;
});
});
Expand Down

0 comments on commit 9669e3c

Please sign in to comment.