We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9443bb1 commit f6b8b69Copy full SHA for f6b8b69
pytorch_lightning/utilities/metrics.py
@@ -27,13 +27,13 @@ def metrics_to_scalars(metrics: Any) -> Any:
27
28
Raises:
29
MisconfigurationException:
30
- If ``value`` contains multiple elements, hence preventing conversion to ``float``
+ If tensors inside ``metrics`` contains multiple elements, hence preventing conversion to a scalar.
31
"""
32
33
def to_item(value: torch.Tensor) -> numbers.Number:
34
if value.numel() != 1:
35
raise MisconfigurationException(
36
- f"The metric `{value}` does not contain a single element" f" thus it cannot be converted to float."
+ f"The metric `{value}` does not contain a single element, thus it cannot be converted to a scalar."
37
)
38
return value.item()
39
0 commit comments