MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / wrapper

Function wrapper

models/losses/utils.py:115–119  ·  view source on GitHub ↗
(pred, target, weight=None, reduction="mean", avg_factor=None, **kwargs)

Source from the content-addressed store, hash-verified

113
114 @functools.wraps(loss_func)
115 def wrapper(pred, target, weight=None, reduction="mean", avg_factor=None, **kwargs):
116 # get element-wise loss
117 loss = loss_func(pred, target, **kwargs)
118 loss = weight_reduce_loss(loss, weight, reduction, avg_factor)
119 return loss
120
121 return wrapper

Callers

nothing calls this directly

Calls 1

weight_reduce_lossFunction · 0.70

Tested by

no test coverage detected