@@ -5939,6 +5939,23 @@ func Softsign(scope *Scope, features tf.Output) (activations tf.Output) {
5939
5939
return op.Output(0)
5940
5940
}
5941
5941
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
+
5942
5959
// Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors.
5943
5960
//
5944
5961
// 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) {
5964
5981
// strides: 1-D of length 4. The stride of the sliding window for each dimension
5965
5982
// of `input`.
5966
5983
// 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) {
5968
5985
if scope.Err() != nil {
5969
5986
return
5970
5987
}
5971
5988
attrs := map[string]interface{}{"strides": strides, "padding": padding}
5989
+ for _, a := range optional {
5990
+ a(attrs)
5991
+ }
5972
5992
opspec := tf.OpSpec{
5973
5993
Type: "DepthwiseConv2dNative",
5974
5994
Input: []tf.Input{
@@ -9765,26 +9785,51 @@ func RequantizationRange(scope *Scope, input tf.Output, input_min tf.Output, inp
9765
9785
return op.Output(0), op.Output(1)
9766
9786
}
9767
9787
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
+
9768
9805
// Computes the gradients of depthwise convolution with respect to the input.
9769
9806
//
9770
9807
// 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.
9773
9811
// filter: 4-D with shape
9774
9812
// `[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]`.
9776
9816
// Gradients w.r.t. the output of the convolution.
9777
9817
// strides: The stride of the sliding window for each dimension of the input
9778
9818
// of the convolution.
9779
9819
// padding: The type of padding algorithm to use.
9780
9820
//
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) {
9784
9826
if scope.Err() != nil {
9785
9827
return
9786
9828
}
9787
9829
attrs := map[string]interface{}{"strides": strides, "padding": padding}
9830
+ for _, a := range optional {
9831
+ a(attrs)
9832
+ }
9788
9833
opspec := tf.OpSpec{
9789
9834
Type: "DepthwiseConv2dNativeBackpropInput",
9790
9835
Input: []tf.Input{
@@ -11947,14 +11992,35 @@ func QuantizeV2(scope *Scope, input tf.Output, min_range tf.Output, max_range tf
11947
11992
return op.Output(0), op.Output(1), op.Output(2)
11948
11993
}
11949
11994
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
+
11950
12012
// Computes the gradients of depthwise convolution with respect to the filter.
11951
12013
//
11952
12014
// 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.
11954
12018
// filter_sizes: An integer vector representing the tensor shape of `filter`,
11955
12019
// where `filter` is a 4-D
11956
12020
// `[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]`.
11958
12024
// Gradients w.r.t. the output of the convolution.
11959
12025
// strides: The stride of the sliding window for each dimension of the input
11960
12026
// of the convolution.
@@ -11963,11 +12029,14 @@ func QuantizeV2(scope *Scope, input tf.Output, min_range tf.Output, max_range tf
11963
12029
// Returns 4-D with shape
11964
12030
// `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t.
11965
12031
// 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) {
11967
12033
if scope.Err() != nil {
11968
12034
return
11969
12035
}
11970
12036
attrs := map[string]interface{}{"strides": strides, "padding": padding}
12037
+ for _, a := range optional {
12038
+ a(attrs)
12039
+ }
11971
12040
opspec := tf.OpSpec{
11972
12041
Type: "DepthwiseConv2dNativeBackpropFilter",
11973
12042
Input: []tf.Input{
0 commit comments