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

Function QuantizeV2

tensorflow/go/op/wrappers.go:480–497  ·  view source on GitHub ↗

Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. [min_range, max_range] are scalar floats that specify the range for the 'input' data. The 'mode' attribute controls exactly which calculations are used to convert the float values to their quantized equivalents. The 'round_m

(scope *Scope, input tf.Output, min_range tf.Output, max_range tf.Output, T tf.DataType, optional ...QuantizeV2Attr)

Source from the content-addressed store, hash-verified

478//
479// Returns The quantized data produced from the float input.The actual minimum scalar value used for the output.The actual maximum scalar value used for the output.
480func QuantizeV2(scope *Scope, input tf.Output, min_range tf.Output, max_range tf.Output, T tf.DataType, optional ...QuantizeV2Attr) (output tf.Output, output_min tf.Output, output_max tf.Output) {
481 if scope.Err() != nil {
482 return
483 }
484 attrs := map[string]interface{}{"T": T}
485 for _, a := range optional {
486 a(attrs)
487 }
488 opspec := tf.OpSpec{
489 Type: "QuantizeV2",
490 Input: []tf.Input{
491 input, min_range, max_range,
492 },
493 Attrs: attrs,
494 }
495 op := scope.AddOperation(opspec)
496 return op.Output(0), op.Output(1), op.Output(2)
497}
498
499// QuantizeAndDequantizeV3Attr is an optional argument to QuantizeAndDequantizeV3.
500type QuantizeAndDequantizeV3Attr 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