Skip to content

Commit

Permalink
Fix torch deprecated warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Jun 21, 2024
1 parent 36d4a57 commit 9f265af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions skrl/resources/schedulers/torch/kl_adaptive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Optional, Union

from packaging import version

import torch
from torch.optim.lr_scheduler import _LRScheduler

Expand Down Expand Up @@ -50,6 +52,8 @@ def __init__(self,
:param verbose: Verbose mode (default: ``False``)
:type verbose: bool, optional
"""
if version.parse(torch.__version__) >= version.parse("2.2"):
verbose = "deprecated"
super().__init__(optimizer, last_epoch, verbose)

self.kl_threshold = kl_threshold
Expand Down

0 comments on commit 9f265af

Please sign in to comment.