getParameters can return an empty tensor

If parameters() is not defined or returns an empty table, the method
getParameters() will return an empty tensor.