aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-10-04 11:55:48 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-04 12:04:49 -0700
commitb82c4dad705bffac6d14a189605c9ece89f8c17b (patch)
tree1d4524ca3cbbdb0e3bb0431494efc9afa775e1e3 /tensorflow/go
parent2390b48b11efda60a0f68a683c94af9612a5306f (diff)
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 215777837
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 b4d4db3e4d..a7bbb80c82 100644
--- a/tensorflow/go/op/wrappers.go
+++ b/tensorflow/go/op/wrappers.go
@@ -29094,6 +29094,17 @@ func TensorArrayGradV2(scope *Scope, handle tf.Output, flow_in tf.Output, source
return op.Output(0)
}
+// SubstrAttr is an optional argument to Substr.
+type SubstrAttr func(optionalAttr)
+
+// SubstrUnit sets the optional unit attribute to value.
+// If not specified, defaults to "BYTE"
+func SubstrUnit(value string) SubstrAttr {
+ return func(m optionalAttr) {
+ m["unit"] = value
+ }
+}
+
// Return substrings from `Tensor` of strings.
//
// For each string in the input `Tensor`, creates a substring starting at index
@@ -29178,15 +29189,20 @@ func TensorArrayGradV2(scope *Scope, handle tf.Output, flow_in tf.Output, source
// len: Scalar defining the number of characters to include in each substring
//
// Returns Tensor of substrings
-func Substr(scope *Scope, input tf.Output, pos tf.Output, len tf.Output) (output tf.Output) {
+func Substr(scope *Scope, input tf.Output, pos tf.Output, len tf.Output, optional ...SubstrAttr) (output tf.Output) {
if scope.Err() != nil {
return
}
+ attrs := map[string]interface{}{}
+ for _, a := range optional {
+ a(attrs)
+ }
opspec := tf.OpSpec{
Type: "Substr",
Input: []tf.Input{
input, pos, len,
},
+ Attrs: attrs,
}
op := scope.AddOperation(opspec)
return op.Output(0)