fix MetadataTensor example (#78073)
```py
[bar if bar for bar in foo]
```
is invalid Python syntax. The `if` clause needs to be at the end:
```py
[bar for bar in foo if bar]
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78073
Approved by: https://github.com/albanD