autocast.metrics.base#

class BaseMetric(reduce_all=True, dist_sync_on_step=False)[source]#

Bases: Metric, Generic[TPred, TTrue], ABC

Shared template for spatial metrics that reduce over spatial axes.

Parameters:
  • reduce_all (bool)

  • dist_sync_on_step (bool)

score(y_pred, y_true)[source]#
Parameters:
Return type:

Float[Tensor, ‘batch time channel’] | Float[Tensor, ‘batch spatial *spatial channel’] | Float[Tensor, ‘batch time spatial *spatial channel’]

update(y_pred, y_true)[source]#

Update metric state with a batch of predictions and targets.

Parameters:
Return type:

None

compute()[source]#

Compute final metric value.

Return type:

Tensor

reset()[source]#

Reset metric state and initialization flag.

Return type:

None