add clear functionality to list (#17050)
Summary:
Add clear functionality to list. See #16662
```python
import torch
torch.jit.script
def foo():
a = [1, 2, 3, 4]
a.clear()
return a
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17050
Differential Revision: D14071799
Pulled By: driazati
fbshipit-source-id: 305551c16f7db127c43de0ad5885d9f10678e101