MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IsGradientNode

Function IsGradientNode

tensorflow/core/graph/quantize_training.cc:71–74  ·  view source on GitHub ↗

Decide if a node is in backward pass by checking if its name is led by "gradients". TODO(jmchen): Make this check more robust as it is not guaranteed that the forward node will not be named with a leading "gradients".

Source from the content-addressed store, hash-verified

69// TODO(jmchen): Make this check more robust as it is not guaranteed that the
70// forward node will not be named with a leading "gradients".
71inline bool IsGradientNode(const Graph* graph, const Node* node) {
72 static const string tag = "gradients";
73 return (node->name().compare(0, tag.size(), tag) == 0);
74}
75
76// Find the type of the input to set the parameters for the
77// quantize_and_dequantize op.

Callers 1

DoQuantizeTrainingFunction · 0.85

Calls 3

nameMethod · 0.65
compareMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected