12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
from typing import Any , Callable , Optional
15
- from warnings import warn
16
15
17
16
import torch
17
+ from deprecate import deprecated , void
18
18
from torch import Tensor
19
19
20
20
from torchmetrics .classification .stat_scores import StatScores
@@ -188,6 +188,7 @@ class FBeta(FBetaScore):
188
188
tensor(0.3333)
189
189
"""
190
190
191
+ @deprecated (target = FBetaScore , deprecated_in = "0.7" , remove_in = "0.8" )
191
192
def __init__ (
192
193
self ,
193
194
num_classes : Optional [int ] = None ,
@@ -203,20 +204,19 @@ def __init__(
203
204
process_group : Optional [Any ] = None ,
204
205
dist_sync_fn : Callable = None ,
205
206
) -> None :
206
- warn ("`FBeta` was renamed to `FBetaScore` in v0.7 and it will be removed in v0.8" , DeprecationWarning )
207
- super ().__init__ (
208
- num_classes = num_classes ,
209
- beta = beta ,
210
- threshold = threshold ,
211
- average = average ,
212
- mdmc_average = mdmc_average ,
213
- ignore_index = ignore_index ,
214
- top_k = top_k ,
215
- multiclass = multiclass ,
216
- compute_on_step = compute_on_step ,
217
- dist_sync_on_step = dist_sync_on_step ,
218
- process_group = process_group ,
219
- dist_sync_fn = dist_sync_fn ,
207
+ void (
208
+ num_classes ,
209
+ beta ,
210
+ threshold ,
211
+ average ,
212
+ mdmc_average ,
213
+ ignore_index ,
214
+ top_k ,
215
+ multiclass ,
216
+ compute_on_step ,
217
+ dist_sync_on_step ,
218
+ process_group ,
219
+ dist_sync_fn ,
220
220
)
221
221
222
222
@@ -363,9 +363,7 @@ class F1(F1Score):
363
363
tensor(0.3333)
364
364
"""
365
365
366
- is_differentiable = False
367
- higher_is_better = True
368
-
366
+ @deprecated (target = F1Score , deprecated_in = "0.7" , remove_in = "0.8" )
369
367
def __init__ (
370
368
self ,
371
369
num_classes : Optional [int ] = None ,
@@ -380,17 +378,16 @@ def __init__(
380
378
process_group : Optional [Any ] = None ,
381
379
dist_sync_fn : Callable = None ,
382
380
) -> None :
383
- warn ("`F1` was renamed to `F1Score` in v0.7 and it will be removed in v0.8" , DeprecationWarning )
384
- super ().__init__ (
385
- num_classes = num_classes ,
386
- threshold = threshold ,
387
- average = average ,
388
- mdmc_average = mdmc_average ,
389
- ignore_index = ignore_index ,
390
- top_k = top_k ,
391
- multiclass = multiclass ,
392
- compute_on_step = compute_on_step ,
393
- dist_sync_on_step = dist_sync_on_step ,
394
- process_group = process_group ,
395
- dist_sync_fn = dist_sync_fn ,
381
+ void (
382
+ num_classes ,
383
+ threshold ,
384
+ average ,
385
+ mdmc_average ,
386
+ ignore_index ,
387
+ top_k ,
388
+ multiclass ,
389
+ compute_on_step ,
390
+ dist_sync_on_step ,
391
+ process_group ,
392
+ dist_sync_fn ,
396
393
)
0 commit comments