mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
use guard_or_false in checkInBoundsForStorage (#155874)
this was added in https://github.com/pytorch/pytorch/pull/147354, the comment already justify guard_or_false Pull Request resolved: https://github.com/pytorch/pytorch/pull/155874 Approved by: https://github.com/bobrenjc93
This commit is contained in:
committed by
PyTorch MergeBot
parent
d79651571f
commit
7070ab3180
@ -101,7 +101,7 @@ inline void checkInBoundsForStorage(
|
||||
// It's ok to always evaluate to False for this early return for SymInts because
|
||||
// (1) maybe_convert_symint below only installs guard for int64_t case
|
||||
// (2) we check for this condition in the TORCH_MAYBE_SYM_CHECK below
|
||||
if (TORCH_GUARD_SIZE_OBLIVIOUS(sym_eq(storage_size_bytes, 0))) {
|
||||
if (TORCH_GUARD_OR_FALSE(sym_eq(storage_size_bytes, 0))) {
|
||||
// NB: (a tensor with arbitrary 0 dims)'s storage can have any numel.
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user