The += here should be removed, otherwise the losses parameter of the first asset_output will be mutated!