mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
Go: Update generated wrapper functions for TensorFlow ops.
PiperOrigin-RevId: 161727345
This commit is contained in:
parent
c65f691196
commit
fe5338177d
|
|
@ -1514,48 +1514,6 @@ func Slice(scope *Scope, input tf.Output, begin tf.Output, size tf.Output) (outp
|
|||
return op.Output(0)
|
||||
}
|
||||
|
||||
// ShapeNAttr is an optional argument to ShapeN.
|
||||
type ShapeNAttr func(optionalAttr)
|
||||
|
||||
// ShapeNOutType sets the optional out_type attribute to value.
|
||||
// If not specified, defaults to DT_INT32
|
||||
func ShapeNOutType(value tf.DataType) ShapeNAttr {
|
||||
return func(m optionalAttr) {
|
||||
m["out_type"] = value
|
||||
}
|
||||
}
|
||||
|
||||
// Returns shape of tensors.
|
||||
//
|
||||
// This operation returns N 1-D integer tensors representing shape of `input[i]s`.
|
||||
func ShapeN(scope *Scope, input []tf.Output, optional ...ShapeNAttr) (output []tf.Output) {
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
attrs := map[string]interface{}{}
|
||||
for _, a := range optional {
|
||||
a(attrs)
|
||||
}
|
||||
opspec := tf.OpSpec{
|
||||
Type: "ShapeN",
|
||||
Input: []tf.Input{
|
||||
tf.OutputList(input),
|
||||
},
|
||||
Attrs: attrs,
|
||||
}
|
||||
op := scope.AddOperation(opspec)
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
var idx int
|
||||
var err error
|
||||
if output, idx, err = makeOutputList(op, idx, "output"); err != nil {
|
||||
scope.UpdateErr("ShapeN", err)
|
||||
return
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
// Checks a tensor for NaN and Inf values.
|
||||
//
|
||||
// When run, reports an `InvalidArgument` error if `tensor` has any values
|
||||
|
|
@ -1662,21 +1620,6 @@ func StopGradient(scope *Scope, input tf.Output) (output tf.Output) {
|
|||
return op.Output(0)
|
||||
}
|
||||
|
||||
// Return a tensor with the same shape and contents as the input tensor or value.
|
||||
func Identity(scope *Scope, input tf.Output) (output tf.Output) {
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
opspec := tf.OpSpec{
|
||||
Type: "Identity",
|
||||
Input: []tf.Input{
|
||||
input,
|
||||
},
|
||||
}
|
||||
op := scope.AddOperation(opspec)
|
||||
return op.Output(0)
|
||||
}
|
||||
|
||||
// Gather slices from `params` into a Tensor with shape specified by `indices`.
|
||||
//
|
||||
// `indices` is an K-dimensional integer tensor, best thought of as a
|
||||
|
|
@ -5416,6 +5359,103 @@ func DynamicStitch(scope *Scope, indices []tf.Output, data []tf.Output) (merged
|
|||
return op.Output(0)
|
||||
}
|
||||
|
||||
// Return a tensor with the same shape and contents as the input tensor or value.
|
||||
func Identity(scope *Scope, input tf.Output) (output tf.Output) {
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
opspec := tf.OpSpec{
|
||||
Type: "Identity",
|
||||
Input: []tf.Input{
|
||||
input,
|
||||
},
|
||||
}
|
||||
op := scope.AddOperation(opspec)
|
||||
return op.Output(0)
|
||||
}
|
||||
|
||||
// Converts the given string representing a handle to an iterator to a resource.
|
||||
//
|
||||
// Arguments:
|
||||
// string_handle: A string representation of the given handle.
|
||||
//
|
||||
// Returns A handle to an iterator resource.
|
||||
func IteratorFromStringHandle(scope *Scope, string_handle tf.Output) (resource_handle tf.Output) {
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
opspec := tf.OpSpec{
|
||||
Type: "IteratorFromStringHandle",
|
||||
Input: []tf.Input{
|
||||
string_handle,
|
||||
},
|
||||
}
|
||||
op := scope.AddOperation(opspec)
|
||||
return op.Output(0)
|
||||
}
|
||||
|
||||
// ShapeNAttr is an optional argument to ShapeN.
|
||||
type ShapeNAttr func(optionalAttr)
|
||||
|
||||
// ShapeNOutType sets the optional out_type attribute to value.
|
||||
// If not specified, defaults to DT_INT32
|
||||
func ShapeNOutType(value tf.DataType) ShapeNAttr {
|
||||
return func(m optionalAttr) {
|
||||
m["out_type"] = value
|
||||
}
|
||||
}
|
||||
|
||||
// Returns shape of tensors.
|
||||
//
|
||||
// This operation returns N 1-D integer tensors representing shape of `input[i]s`.
|
||||
func ShapeN(scope *Scope, input []tf.Output, optional ...ShapeNAttr) (output []tf.Output) {
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
attrs := map[string]interface{}{}
|
||||
for _, a := range optional {
|
||||
a(attrs)
|
||||
}
|
||||
opspec := tf.OpSpec{
|
||||
Type: "ShapeN",
|
||||
Input: []tf.Input{
|
||||
tf.OutputList(input),
|
||||
},
|
||||
Attrs: attrs,
|
||||
}
|
||||
op := scope.AddOperation(opspec)
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
var idx int
|
||||
var err error
|
||||
if output, idx, err = makeOutputList(op, idx, "output"); err != nil {
|
||||
scope.UpdateErr("ShapeN", err)
|
||||
return
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
// Converts the given `resource_handle` representing an iterator to a string.
|
||||
//
|
||||
// Arguments:
|
||||
// resource_handle: A handle to an iterator resource.
|
||||
//
|
||||
// Returns A string representation of the given handle.
|
||||
func IteratorToStringHandle(scope *Scope, resource_handle tf.Output) (string_handle tf.Output) {
|
||||
if scope.Err() != nil {
|
||||
return
|
||||
}
|
||||
opspec := tf.OpSpec{
|
||||
Type: "IteratorToStringHandle",
|
||||
Input: []tf.Input{
|
||||
resource_handle,
|
||||
},
|
||||
}
|
||||
op := scope.AddOperation(opspec)
|
||||
return op.Output(0)
|
||||
}
|
||||
|
||||
// QueueCloseV2Attr is an optional argument to QueueCloseV2.
|
||||
type QueueCloseV2Attr func(optionalAttr)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user