Shortcuts

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

to_reduce (Tensor) –

the tensor, which shall be reduced

reduction : a string specifying the reduction method (‘elementwise_mean’, ‘none’, ‘sum’)

Return type

Tensor

Returns

reduced Tensor

Raise:

ValueError if an invalid reduction parameter was given