Fixes in `GlobalAverageLossMetric` and `PerplexityMetric`
1. Fix assertions in `pl_utils.py`. `assert (condition, message)` is incorrect use of assertion.
2. Fix function `reference_loss_func` in file `pl_utils.py`. Previously the function implicitly modified its argument `loss_sum_or_avg`.
3. Fix method `update` in class `GlobalAverageLossMetric`. Previously it implicitly modified its argument `loss` if `self.take_avg_loss` was `True`. Also detach inputs argument `loss` from graph.
4. Detach arguments of `PerplexityMetric.update` from graph.
5. Several fixes in docstrings.