aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-09-25 14:01:59 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-25 14:08:11 -0700
commit153578f3c90ca423501151adcbaf6b81e05e2440 (patch)
treeeda8d1f9676594a12dd60b58e9fe7d5c0fc1fb4c /tensorflow/go
parentb8c6aa794d8c5b6ecda487f81ea28699b0793a81 (diff)
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 214499338
Diffstat (limited to 'tensorflow/go')
-rw-r--r--tensorflow/go/op/wrappers.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/tensorflow/go/op/wrappers.go b/tensorflow/go/op/wrappers.go
index 8b60e6fd25..9dd487e73b 100644
--- a/tensorflow/go/op/wrappers.go
+++ b/tensorflow/go/op/wrappers.go
@@ -12211,6 +12211,17 @@ func FixedLengthRecordReaderV2(scope *Scope, record_bytes int64, optional ...Fix
return op.Output(0)
}
+// StringLengthAttr is an optional argument to StringLength.
+type StringLengthAttr func(optionalAttr)
+
+// StringLengthUnit sets the optional unit attribute to value.
+// If not specified, defaults to "BYTE"
+func StringLengthUnit(value string) StringLengthAttr {
+ return func(m optionalAttr) {
+ m["unit"] = value
+ }
+}
+
// String lengths of `input`.
//
// Computes the length of each string given in the input tensor.
@@ -12220,15 +12231,20 @@ func FixedLengthRecordReaderV2(scope *Scope, record_bytes int64, optional ...Fix
//
// Returns Integer tensor that has the same shape as `input`. The output contains the
// element-wise string lengths of `input`.
-func StringLength(scope *Scope, input tf.Output) (output tf.Output) {
+func StringLength(scope *Scope, input tf.Output, optional ...StringLengthAttr) (output tf.Output) {
if scope.Err() != nil {
return
}
+ attrs := map[string]interface{}{}
+ for _, a := range optional {
+ a(attrs)
+ }
opspec := tf.OpSpec{
Type: "StringLength",
Input: []tf.Input{
input,
},
+ Attrs: attrs,
}
op := scope.AddOperation(opspec)
return op.Output(0)