diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-07-25 09:45:23 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-07-25 09:49:31 -0700 |
commit | fa69d6531cc6cfe865a3ffc63c58f3c2fe0ec4df (patch) | |
tree | c1a84ee3130536c7864ce87a2da8656ee6411fdc /tensorflow/go | |
parent | 0ff2abfaf7f418d0547eaa0cf9ee0a32b32fb490 (diff) |
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 206007600
Diffstat (limited to 'tensorflow/go')
-rw-r--r-- | tensorflow/go/op/wrappers.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tensorflow/go/op/wrappers.go b/tensorflow/go/op/wrappers.go index 18d7425323..6c9bf1e714 100644 --- a/tensorflow/go/op/wrappers.go +++ b/tensorflow/go/op/wrappers.go @@ -5225,12 +5225,26 @@ func IsBoostedTreesEnsembleInitialized(scope *Scope, tree_ensemble_handle tf.Out return op.Output(0) } +// CastAttr is an optional argument to Cast. +type CastAttr func(optionalAttr) + +// CastTruncate sets the optional Truncate attribute to value. +// If not specified, defaults to false +func CastTruncate(value bool) CastAttr { + return func(m optionalAttr) { + m["Truncate"] = value + } +} + // Cast x of type SrcT to y of DstT. -func Cast(scope *Scope, x tf.Output, DstT tf.DataType) (y tf.Output) { +func Cast(scope *Scope, x tf.Output, DstT tf.DataType, optional ...CastAttr) (y tf.Output) { if scope.Err() != nil { return } attrs := map[string]interface{}{"DstT": DstT} + for _, a := range optional { + a(attrs) + } opspec := tf.OpSpec{ Type: "Cast", Input: []tf.Input{ |