You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
`ET_CHECK_VALID_DIM` checks whether a tensor has a valid dimension. However, for 0-D tensors, some behaviors are different.
Accessing size/stride for dim=0 is invalid, because the valid dimension is [-0, 0) which is none.
```
torch.tensor(2).size(dim=0)
```
However, some ops allow accessing dim=0 or -1 for a 0-D tensor
```
torch.mean(torch.tensor(2, dtype=float), dim=-1)
```
Therefore, in reduce_util helper functions and ops, we need to special handle that case.
We also want to revisit this check for 0-D tensor case for ops.
Reviewed By: manuelcandales
Differential Revision: D48319644
fbshipit-source-id: 0a394ab4caccbcbb7868ccd371276e9dd047f054
0 commit comments