Forward fix internal pyre failure from D58983461

Summary:
X-link: https://github.com/pytorch/pytorch/pull/129525

Somehow, using underscore alias of some builtin types breaks pyre

Reviewed By: malfet, clee2000

Differential Revision: D59029768

fbshipit-source-id: cfa2171b66475727b9545355e57a8297c1dc0bc6
This commit is contained in:
Huy Do
2024-06-27 07:35:18 -07:00
committed by Facebook GitHub Bot
parent 89653419d0
commit 51fd114d8b
5 changed files with 5 additions and 8 deletions

View File

@@ -270,6 +270,8 @@ class TensorProperties(nn.Module):
# to have the same shape as the input tensor.
new_dims = len(tensor_dims) - len(idx_dims)
new_shape = idx_dims + (1,) * new_dims
# pyre-fixme[58]: `+` is not supported for operand types
# `Tuple[int]` and `torch._C.Size`
expand_dims = (-1,) + tensor_dims[1:]
_batch_idx = _batch_idx.view(*new_shape)
_batch_idx = _batch_idx.expand(*expand_dims)