MCPcopy Create free account
hub / github.com/ChunmingHe/WS-SAM / wrapper

Function wrapper

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

weight_reduce_lossFunction · 0.85

Tested by

no test coverage detected