- CodeCarbon version: 1.2.0
- Python version: 3.7
- Operating System: MacOS
Description
Hi,
I encountered a problem with the track_emissions decorator.
While trying to wrap the training function of my model, which has the particularity to return a result (an element of a "Model" class needed for my use case), I realized that the track_emissions decorator was forcing a None return.
The problem (if it is one) seems to come from the track_emissions function :
line 478 and line 489
store the return of fn :
return_fn = fn(*args, **kwargs)
and then add
return return_fn
in
|
def wrapped_fn(*args, **kwargs): |
Thank you !
Julien
Description
Hi,
I encountered a problem with the track_emissions decorator.
While trying to wrap the training function of my model, which has the particularity to return a result (an element of a "Model" class needed for my use case), I realized that the track_emissions decorator was forcing a None return.
The problem (if it is one) seems to come from the track_emissions function :
codecarbon/codecarbon/emissions_tracker.py
Line 415 in c284dc5
line 478 and line 489
codecarbon/codecarbon/emissions_tracker.py
Line 478 in c284dc5
codecarbon/codecarbon/emissions_tracker.py
Line 489 in c284dc5
store the return of fn :
return_fn = fn(*args, **kwargs)and then add
return return_fnin
codecarbon/codecarbon/emissions_tracker.py
Line 460 in c284dc5
Thank you !
Julien