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

Function _GetReverseOrderedGrads

caffe2/python/data_parallel_model.py:1545–1550  ·  view source on GitHub ↗

Returns the gradients in reverse order (namespace stripped), for the optimal synchronization order.

(model)

Source from the content-addressed store, hash-verified

1543
1544
1545def _GetReverseOrderedGrads(model):
1546 '''
1547 Returns the gradients in reverse order (namespace stripped),
1548 for the optimal synchronization order.
1549 '''
1550 return list(reversed(model._grad_names))
1551
1552
1553# A helper function to extract a parameter's name

Callers 1

ParallelizeFunction · 0.85

Calls 2

listFunction · 0.85
reversedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…