MCPcopy Create free account
hub / github.com/pytorch/pytorch / dedup

Method dedup

caffe2/python/optimizer.py:241–250  ·  view source on GitHub ↗
(net, sparse_dedup_aggregator, grad)

Source from the content-addressed store, hash-verified

239
240 @staticmethod
241 def dedup(net, sparse_dedup_aggregator, grad):
242 assert isinstance(
243 grad, core.GradientSlice
244 ), "Dedup only works for sparse gradient, got {}".format(grad)
245 if sparse_dedup_aggregator:
246 return net.DeduplicateGradientSlices(
247 grad, aggregator=sparse_dedup_aggregator
248 )
249 else:
250 return grad
251
252 def get_auxiliary_parameters(self):
253 """Returns a list of auxiliary parameters.

Callers 7

_runMethod · 0.80
_runMethod · 0.80
_runMethod · 0.80
_runMethod · 0.80
_runMethod · 0.80
_runMethod · 0.80
_runMethod · 0.80

Calls 3

isinstanceFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected