tensorflow:: ops:: Conv
#include <nn_ops.h>
Computes a N-D convolution given (N+1+batch_dims)-D input
and (N+2)-D filter
tensors.
Summary
General function for computing a N-D convolution. It is required that 1 <= N <= 3
.
Args:
- scope: A Scope object
- input: Tensor of type T and shape
batch_shape + spatial_shape + [in_channels]
in the case thatchannels_last_format = true
or shapebatch_shape + [in_channels] + spatial_shape
ifchannels_last_format = false
. spatial_shape is N-dimensional withN=2
orN=3
. Also note thatbatch_shape
is dictated by the parameterbatch_dims
and defaults to 1. - filter: An
(N+2)-D
Tensor with the same type asinput
and shapespatial_filter_shape + [in_channels, out_channels]
, where spatial_filter_shape is N-dimensional withN=2
orN=3
. - strides: 1-D tensor of length
N+2
. The stride of the sliding window for each dimension ofinput
. Must havestrides[0] = strides[N+1] = 1
. - padding: The type of padding algorithm to use.
Optional attributes (see Attrs
):
- explicit_paddings: If
padding
is"EXPLICIT"
, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension isexplicit_paddings[2 * i]
andexplicit_paddings[2 * i + 1]
, respectively. Ifpadding
is not"EXPLICIT"
,explicit_paddings
must be empty. - data_format: Used to set the data format. By default
CHANNELS_FIRST
, usesNHWC (2D) / NDHWC (3D)
or ifCHANNELS_LAST
, usesNCHW (2D) / NCDHW (3D)
. - dilations: 1-D tensor of length
N+2
. The dilation factor for each dimension ofinput
. If set tok > 1
, there will bek-1
skipped cells between each filter element on that dimension. The dimension order is determined by the value ofchannels_last_format
, see above for details. Dilations in the batch and depth dimensions must be 1. - batch_dims: A positive integer specifying the number of batch dimensions for the input tensor. Should be less than the rank of the input tensor.
- groups: A positive integer specifying the number of groups in which the input is split along the channel axis. Each group is convolved separately with
filters / groups
filters. The output is the concatenation of all the groups results along the channel axis. Input channels and filters must both be divisible by groups.
Returns:
Output
: A (N+1+batch_dims)-D tensor. The dimension order is determined by the value ofchannels_last_format
, see below for details.
Constructors and Destructors |
|
---|---|
Conv(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding)
|
|
Conv(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const Conv::Attrs & attrs)
|
Public attributes |
|
---|---|
operation
|
|
output
|
Public functions |
|
---|---|
node() const
|
::tensorflow::Node *
|
operator::tensorflow::Input() const
|
|
operator::tensorflow::Output() const
|
|
Public static functions |
|
---|---|
BatchDims(int64 x)
|
|
DataFormat(StringPiece x)
|
|
Dilations(const gtl::ArraySlice< int > & x)
|
|
ExplicitPaddings(const gtl::ArraySlice< int > & x)
|
|
Groups(int64 x)
|
Structs |
|
---|---|
tensorflow:: |
Optional attribute setters for Conv. |
Public attributes
operation
Operation operation
output
::tensorflow::Output output
Public functions
Conv
Conv( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding )
Conv
Conv( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const Conv::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
BatchDims
Attrs BatchDims( int64 x )
DataFormat
Attrs DataFormat( StringPiece x )
Dilations
Attrs Dilations( const gtl::ArraySlice< int > & x )
ExplicitPaddings
Attrs ExplicitPaddings( const gtl::ArraySlice< int > & x )
Groups
Attrs Groups( int64 x )