pytorch_lightning.metrics.functional.reduction module¶
-
pytorch_lightning.metrics.functional.reduction.
reduce
(to_reduce, reduction)[source]¶ Reduces a given tensor by a given reduction method
- Parameters
the tensor, which shall be reduced
reduction : a string specifying the reduction method (‘elementwise_mean’, ‘none’, ‘sum’)
- Return type
- Returns
reduced Tensor
- Raise:
ValueError if an invalid reduction parameter was given