Skip to content

Commit 34a659e

Browse files
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 648987586
1 parent 1358bb6 commit 34a659e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tensorflow/go/op/wrappers.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17336,6 +17336,26 @@ func FakeQuantWithMinMaxVarsNarrowRange(value bool) FakeQuantWithMinMaxVarsAttr
1733617336
//
1733717337
// This operation has a gradient and thus allows for training `min` and `max`
1733817338
// values.
17339+
//
17340+
// >>> constant_input = tf.constant([[1.2, -0.3, 0.7], [2.1, 0.5, -1.0]], dtype=tf.float32)
17341+
// >>>
17342+
// >>> min_val = -0.5
17343+
// >>> max_val = 0.8
17344+
// >>> num_bits = 8
17345+
// >>> narrow_range = False #False:for the quantization range [0; 2^num_bits - 1]
17346+
// >>>
17347+
// >>> quantized_data = tf.quantization.fake_quant_with_min_max_vars(
17348+
// ... inputs=constant_input, min=min_val, max=max_val, num_bits=num_bits, narrow_range=narrow_range
17349+
// ... )
17350+
// >>>
17351+
// >>> print("Input:\n", constant_input.numpy())
17352+
// Input:
17353+
// [[ 1.2 -0.3 0.7]
17354+
// [ 2.1 0.5 -1. ]]
17355+
// >>> print("Output:\n", quantized_data.numpy())
17356+
// Output:
17357+
// [[ 0.8003921 -0.3007843 0.6984313]
17358+
// [ 0.8003921 0.4996078 -0.4996078]]
1733917359
func FakeQuantWithMinMaxVars(scope *Scope, inputs tf.Output, min tf.Output, max tf.Output, optional ...FakeQuantWithMinMaxVarsAttr) (outputs tf.Output) {
1734017360
if scope.Err() != nil {
1734117361
return

0 commit comments

Comments
 (0)