mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
use sym_or instead of any to avoid dde in calc_conv_nd_return_shape (#162084)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/162084 Approved by: https://github.com/aorenste Co-authored-by: Aaron Orenstein <aorenste@fb.com>
This commit is contained in:
committed by
PyTorch MergeBot
parent
8678d831c4
commit
fbf3d2027d
@ -2373,9 +2373,10 @@ def calc_conv_nd_return_shape(
|
||||
ret_shape.append(
|
||||
_formula(dims[i], padding[i], dilation[i], kernel_size[i], stride[i])
|
||||
)
|
||||
from torch.fx.experimental.symbolic_shapes import sym_or
|
||||
|
||||
torch._check(
|
||||
any(x > 0 for x in ret_shape[2:]),
|
||||
sym_or(*[x > 0 for x in ret_shape[2:]]),
|
||||
lambda: f"Given input size per channel: {list(dims)}. "
|
||||
f"Calculated output size per channel: {ret_shape[2:]}. "
|
||||
f"Output size is too small",
|
||||
|
Reference in New Issue
Block a user