MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / wrapper

Function wrapper

detrsmpl/models/losses/utils.py:87–96  ·  view source on GitHub ↗
(pred,
                target,
                weight=None,
                reduction='mean',
                avg_factor=None,
                **kwargs)

Source from the content-addressed store, hash-verified

85 """
86 @functools.wraps(loss_func)
87 def wrapper(pred,
88 target,
89 weight=None,
90 reduction='mean',
91 avg_factor=None,
92 **kwargs):
93 # get element-wise loss
94 loss = loss_func(pred, target, **kwargs)
95 loss = weight_reduce_loss(loss, weight, reduction, avg_factor)
96 return loss
97
98 return wrapper
99

Callers

nothing calls this directly

Calls 1

weight_reduce_lossFunction · 0.85

Tested by

no test coverage detected