Skip to content

Commit 5ac7317

Browse files
Go: Update generated wrapper functions for TensorFlow ops.
Change: 149567254
1 parent 34c3835 commit 5ac7317

File tree

1 file changed

+79
-10
lines changed

1 file changed

+79
-10
lines changed

tensorflow/go/op/wrappers.go

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5939,6 +5939,23 @@ func Softsign(scope *Scope, features tf.Output) (activations tf.Output) {
59395939
return op.Output(0)
59405940
}
59415941

5942+
// DepthwiseConv2dNativeAttr is an optional argument to DepthwiseConv2dNative.
5943+
type DepthwiseConv2dNativeAttr func(optionalAttr)
5944+
5945+
// DepthwiseConv2dNativeDataFormat sets the optional data_format attribute to value.
5946+
//
5947+
// value: Specify the data format of the input and output data. With the
5948+
// default format "NHWC", the data is stored in the order of:
5949+
// [batch, height, width, channels].
5950+
// Alternatively, the format could be "NCHW", the data storage order of:
5951+
// [batch, channels, height, width].
5952+
// If not specified, defaults to "NHWC"
5953+
func DepthwiseConv2dNativeDataFormat(value string) DepthwiseConv2dNativeAttr {
5954+
return func(m optionalAttr) {
5955+
m["data_format"] = value
5956+
}
5957+
}
5958+
59425959
// Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors.
59435960
//
59445961
// Given an input tensor of shape `[batch, in_height, in_width, in_channels]`
@@ -5964,11 +5981,14 @@ func Softsign(scope *Scope, features tf.Output) (activations tf.Output) {
59645981
// strides: 1-D of length 4. The stride of the sliding window for each dimension
59655982
// of `input`.
59665983
// padding: The type of padding algorithm to use.
5967-
func DepthwiseConv2dNative(scope *Scope, input tf.Output, filter tf.Output, strides []int64, padding string) (output tf.Output) {
5984+
func DepthwiseConv2dNative(scope *Scope, input tf.Output, filter tf.Output, strides []int64, padding string, optional ...DepthwiseConv2dNativeAttr) (output tf.Output) {
59685985
if scope.Err() != nil {
59695986
return
59705987
}
59715988
attrs := map[string]interface{}{"strides": strides, "padding": padding}
5989+
for _, a := range optional {
5990+
a(attrs)
5991+
}
59725992
opspec := tf.OpSpec{
59735993
Type: "DepthwiseConv2dNative",
59745994
Input: []tf.Input{
@@ -9765,26 +9785,51 @@ func RequantizationRange(scope *Scope, input tf.Output, input_min tf.Output, inp
97659785
return op.Output(0), op.Output(1)
97669786
}
97679787

9788+
// DepthwiseConv2dNativeBackpropInputAttr is an optional argument to DepthwiseConv2dNativeBackpropInput.
9789+
type DepthwiseConv2dNativeBackpropInputAttr func(optionalAttr)
9790+
9791+
// DepthwiseConv2dNativeBackpropInputDataFormat sets the optional data_format attribute to value.
9792+
//
9793+
// value: Specify the data format of the input and output data. With the
9794+
// default format "NHWC", the data is stored in the order of:
9795+
// [batch, height, width, channels].
9796+
// Alternatively, the format could be "NCHW", the data storage order of:
9797+
// [batch, channels, height, width].
9798+
// If not specified, defaults to "NHWC"
9799+
func DepthwiseConv2dNativeBackpropInputDataFormat(value string) DepthwiseConv2dNativeBackpropInputAttr {
9800+
return func(m optionalAttr) {
9801+
m["data_format"] = value
9802+
}
9803+
}
9804+
97689805
// Computes the gradients of depthwise convolution with respect to the input.
97699806
//
97709807
// Arguments:
9771-
// input_sizes: An integer vector representing the shape of `input`,
9772-
// where `input` is a 4-D `[batch, height, width, channels]` tensor.
9808+
// input_sizes: An integer vector representing the shape of `input`, based
9809+
// on `data_format`. For example, if `data_format` is 'NHWC' then
9810+
// `input` is a 4-D `[batch, height, width, channels]` tensor.
97739811
// filter: 4-D with shape
97749812
// `[filter_height, filter_width, in_channels, depthwise_multiplier]`.
9775-
// out_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`.
9813+
// out_backprop: 4-D with shape based on `data_format`.
9814+
// For example, if `data_format` is 'NHWC' then
9815+
// out_backprop shape is `[batch, out_height, out_width, out_channels]`.
97769816
// Gradients w.r.t. the output of the convolution.
97779817
// strides: The stride of the sliding window for each dimension of the input
97789818
// of the convolution.
97799819
// padding: The type of padding algorithm to use.
97809820
//
9781-
// Returns 4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient
9782-
// w.r.t. the input of the convolution.
9783-
func DepthwiseConv2dNativeBackpropInput(scope *Scope, input_sizes tf.Output, filter tf.Output, out_backprop tf.Output, strides []int64, padding string) (output tf.Output) {
9821+
// Returns 4-D with shape according to `data_format`. For example, if
9822+
// `data_format` is 'NHWC', output shape is `[batch, in_height,
9823+
// in_width, in_channels]`. Gradient w.r.t. the input of the
9824+
// convolution.
9825+
func DepthwiseConv2dNativeBackpropInput(scope *Scope, input_sizes tf.Output, filter tf.Output, out_backprop tf.Output, strides []int64, padding string, optional ...DepthwiseConv2dNativeBackpropInputAttr) (output tf.Output) {
97849826
if scope.Err() != nil {
97859827
return
97869828
}
97879829
attrs := map[string]interface{}{"strides": strides, "padding": padding}
9830+
for _, a := range optional {
9831+
a(attrs)
9832+
}
97889833
opspec := tf.OpSpec{
97899834
Type: "DepthwiseConv2dNativeBackpropInput",
97909835
Input: []tf.Input{
@@ -11947,14 +11992,35 @@ func QuantizeV2(scope *Scope, input tf.Output, min_range tf.Output, max_range tf
1194711992
return op.Output(0), op.Output(1), op.Output(2)
1194811993
}
1194911994

11995+
// DepthwiseConv2dNativeBackpropFilterAttr is an optional argument to DepthwiseConv2dNativeBackpropFilter.
11996+
type DepthwiseConv2dNativeBackpropFilterAttr func(optionalAttr)
11997+
11998+
// DepthwiseConv2dNativeBackpropFilterDataFormat sets the optional data_format attribute to value.
11999+
//
12000+
// value: Specify the data format of the input and output data. With the
12001+
// default format "NHWC", the data is stored in the order of:
12002+
// [batch, height, width, channels].
12003+
// Alternatively, the format could be "NCHW", the data storage order of:
12004+
// [batch, channels, height, width].
12005+
// If not specified, defaults to "NHWC"
12006+
func DepthwiseConv2dNativeBackpropFilterDataFormat(value string) DepthwiseConv2dNativeBackpropFilterAttr {
12007+
return func(m optionalAttr) {
12008+
m["data_format"] = value
12009+
}
12010+
}
12011+
1195012012
// Computes the gradients of depthwise convolution with respect to the filter.
1195112013
//
1195212014
// Arguments:
11953-
// input: 4-D with shape `[batch, in_height, in_width, in_channels]`.
12015+
// input: 4-D with shape based on `data_format`. For example, if
12016+
// `data_format` is 'NHWC' then `input` is a 4-D `[batch, in_height,
12017+
// in_width, in_channels]` tensor.
1195412018
// filter_sizes: An integer vector representing the tensor shape of `filter`,
1195512019
// where `filter` is a 4-D
1195612020
// `[filter_height, filter_width, in_channels, depthwise_multiplier]` tensor.
11957-
// out_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`.
12021+
// out_backprop: 4-D with shape based on `data_format`.
12022+
// For example, if `data_format` is 'NHWC' then
12023+
// out_backprop shape is `[batch, out_height, out_width, out_channels]`.
1195812024
// Gradients w.r.t. the output of the convolution.
1195912025
// strides: The stride of the sliding window for each dimension of the input
1196012026
// of the convolution.
@@ -11963,11 +12029,14 @@ func QuantizeV2(scope *Scope, input tf.Output, min_range tf.Output, max_range tf
1196312029
// Returns 4-D with shape
1196412030
// `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t.
1196512031
// the `filter` input of the convolution.
11966-
func DepthwiseConv2dNativeBackpropFilter(scope *Scope, input tf.Output, filter_sizes tf.Output, out_backprop tf.Output, strides []int64, padding string) (output tf.Output) {
12032+
func DepthwiseConv2dNativeBackpropFilter(scope *Scope, input tf.Output, filter_sizes tf.Output, out_backprop tf.Output, strides []int64, padding string, optional ...DepthwiseConv2dNativeBackpropFilterAttr) (output tf.Output) {
1196712033
if scope.Err() != nil {
1196812034
return
1196912035
}
1197012036
attrs := map[string]interface{}{"strides": strides, "padding": padding}
12037+
for _, a := range optional {
12038+
a(attrs)
12039+
}
1197112040
opspec := tf.OpSpec{
1197212041
Type: "DepthwiseConv2dNativeBackpropFilter",
1197312042
Input: []tf.Input{

0 commit comments

Comments
 (0)