Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove compute_on_step from wrappers #991

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed deprecated `compute_on_step` argument in Image ([#979](https://github.com/PyTorchLightning/metrics/pull/979))


- Removed deprecated `compute_on_step` argument in Wrappers ([#991](https://github.com/PyTorchLightning/metrics/pull/991))


### Fixed

- Fixed "Sort currently does not support bool dtype on CUDA" error in MAP for empty preds ([#983](https://github.com/PyTorchLightning/metrics/pull/983))
Expand Down
9 changes: 1 addition & 8 deletions torchmetrics/wrappers/bootstrapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ class basically keeps multiple copies of the same base metric in memory and when
will be given by :math:`n\sim Poisson(\lambda=1)`, which approximates the true bootstrap distribution
when the number of samples is large. If ``'multinomial'`` is chosen, we will apply true bootstrapping
at the batch level to approximate bootstrapping over the hole dataset.
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False.

.. deprecated:: v0.8
Argument has no use anymore and will be removed v0.9.

kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.

Example::
Expand All @@ -96,10 +90,9 @@ def __init__(
quantile: Optional[Union[float, Tensor]] = None,
raw: bool = False,
sampling_strategy: str = "poisson",
compute_on_step: Optional[bool] = None,
**kwargs: Dict[str, Any],
) -> None:
super().__init__(compute_on_step=compute_on_step, **kwargs)
super().__init__(**kwargs)
if not isinstance(base_metric, Metric):
raise ValueError(
"Expected base metric to be an instance of torchmetrics.Metric" f" but received {base_metric}"
Expand Down
11 changes: 2 additions & 9 deletions torchmetrics/wrappers/minmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict, Optional, Union
from typing import Any, Dict, Union

import torch
from torch import Tensor
Expand All @@ -27,12 +27,6 @@ class MinMaxMetric(Metric):
Args:
base_metric:
The metric of which you want to keep track of its maximum and minimum values.
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False.

.. deprecated:: v0.8
Argument has no use anymore and will be removed v0.9.

kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.

Raises:
Expand Down Expand Up @@ -63,10 +57,9 @@ class MinMaxMetric(Metric):
def __init__(
self,
base_metric: Metric,
compute_on_step: Optional[bool] = None,
**kwargs: Dict[str, Any],
) -> None:
super().__init__(compute_on_step=compute_on_step, **kwargs)
super().__init__(**kwargs)
if not isinstance(base_metric, Metric):
raise ValueError(
f"Expected base metric to be an instance of `torchmetrics.Metric` but received {base_metric}"
Expand Down