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)
| 188 | // `sum(gradients * (inputs < min))`.Backpropagated gradients w.r.t. max parameter: |
| 189 | // `sum(gradients * (inputs > max))`. |
| 190 | func 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. |
| 210 | type FakeQuantWithMinMaxVarsAttr func(optionalAttr) |
nothing calls this directly
no test coverage detected