Can be called inside of the call() method to add a scalar loss.
Example:
```python class MyLayer(Layer):
… def call(self, x): self.add_loss(ops.sum(x)) return x
… def call(self, x):
self.add_loss(ops.sum(x)) return x
```