MCPcopy Index your code
hub / github.com/pytorch/pytorch / create_grad

Function create_grad

caffe2/python/data_parallel_model.py:868–869  ·  view source on GitHub ↗
(lossp)

Source from the content-addressed store, hash-verified

866
867def _AddGradientOperators(devices, model, losses_by_gpu):
868 def create_grad(lossp):
869 return model.ConstantFill(lossp, str(lossp) + "_grad", value=1.0)
870
871 loss_grad = {}
872 # Explicitly need to create gradients on each GPU

Callers 1

_AddGradientOperatorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…