getParameters can return an empty tensor

If `parameters()` is not defined or returns an empty table, the method `getParameters()` will return an empty tensor.
This piece of code reproduces the two problems (nil and empty table parameters):
```
print(nn.View(1):getParameters())
print(nn.Sequential():getParameters())
```