<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_loss(self, loss, name=None):
 """Adds a loss and returns a wrapper for that loss."""

    self.bookkeeper.add_loss(loss, name=name)
    return Loss(self.bookkeeper, tensor=loss, name=name)