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

Function FakeQuantWithMinMaxVarsGradient

tensorflow/go/op/wrappers.go:190–207  ·  view source on GitHub ↗

Compute gradients for a FakeQuantWithMinMaxVars operation. Arguments: gradients: Backpropagated gradients above the FakeQuantWithMinMaxVars operation. inputs: Values passed as inputs to the FakeQuantWithMinMaxVars operation. min, max: Quantization interval, scalar floats. Returns Backpropagate

(scope *Scope, gradients tf.Output, inputs tf.Output, min tf.Output, max tf.Output, optional ...FakeQuantWithMinMaxVarsGradientAttr)

Source from the content-addressed store, hash-verified

188// `sum(gradients * (inputs < min))`.Backpropagated gradients w.r.t. max parameter:
189// `sum(gradients * (inputs > max))`.
190func FakeQuantWithMinMaxVarsGradient(scope *Scope, gradients tf.Output, inputs tf.Output, min tf.Output, max tf.Output, optional ...FakeQuantWithMinMaxVarsGradientAttr) (backprops_wrt_input tf.Output, backprop_wrt_min tf.Output, backprop_wrt_max tf.Output) {
191 if scope.Err() != nil {
192 return
193 }
194 attrs := map[string]interface{}{}
195 for _, a := range optional {
196 a(attrs)
197 }
198 opspec := tf.OpSpec{
199 Type: "FakeQuantWithMinMaxVarsGradient",
200 Input: []tf.Input{
201 gradients, inputs, min, max,
202 },
203 Attrs: attrs,
204 }
205 op := scope.AddOperation(opspec)
206 return op.Output(0), op.Output(1), op.Output(2)
207}
208
209// FakeQuantWithMinMaxVarsAttr is an optional argument to FakeQuantWithMinMaxVars.
210type FakeQuantWithMinMaxVarsAttr func(optionalAttr)

Callers

nothing calls this directly

Calls 4

aClass · 0.85
ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by

no test coverage detected