MCPcopy Create free account
hub / github.com/tensorflow/lingvo / ComputeGradients

Function ComputeGradients

lingvo/core/py_utils.py:3123–3273  ·  view source on GitHub ↗

Computes gradients of variables in vmap w.r.t loss. Args: loss_or_activations: either the loss, which is a scalar tensor, or activations, which could be a tensor or a list of tensors. vmap: A `.NestedMap` of variables. grad_aggregation_method: Specifies the method used to combin

(
    loss_or_activations,
    vmap,
    grad_aggregation_method=tf.AggregationMethod.EXPERIMENTAL_TREE,
    colocate_gradients_with_ops=True,
    gate_gradients=False,
    compute_gradients_fn=None,
    skip_zero_gradients=None,
    use_bf16_gradients_ar=False,
    skip_none_gradients=True,
    defer_crs_to_apply_grad=False,
    activations_grad=None,
    is_activations=False,
    tpu_embedding_activations=None)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 10

FlattenMethod · 0.95
PackMethod · 0.95
HasRankFunction · 0.85
NestedMapClass · 0.85
_UniqueClass · 0.85
use_tpuFunction · 0.85
VarGradClass · 0.85
SkipNoneGradientsFunction · 0.85
TransformWithKeyMethod · 0.80
FilterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…