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

Function wrapper

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

Source from the content-addressed store, hash-verified

77
78 @functools.wraps(loss_func)
79 def wrapper(pred,
80 target,
81 weight=None,
82 reduction='mean',
83 avg_factor=None,
84 **kwargs):
85 # get element-wise loss
86 loss = loss_func(pred, target, **kwargs)
87 loss = weight_reduce_loss(loss, weight, reduction, avg_factor)
88 return loss
89
90 return wrapper
91

Callers

nothing calls this directly

Calls 1

weight_reduce_lossFunction · 0.85

Tested by

no test coverage detected