MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

layers/utils.py:373–382  ·  view source on GitHub ↗
(self, d=2, p=2, size_average=True, reduction=True)

Source from the content-addressed store, hash-verified

371
372class LpLoss(object):
373 def __init__(self, d=2, p=2, size_average=True, reduction=True):
374 super(LpLoss, self).__init__()
375
376 #Dimension and Lp-norm type are postive
377 assert d > 0 and p > 0
378
379 self.d = d
380 self.p = p
381 self.reduction = reduction
382 self.size_average = size_average
383
384 def abs(self, x, y):
385 num_examples = x.size()[0]

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected