MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _non_atrous_convolution

Function _non_atrous_convolution

tensorflow/python/ops/nn_ops.py:86–144  ·  view source on GitHub ↗

Computes sums of N-D convolutions (actually cross correlation). It is required that 1 <= N <= 3. This is used to implement the more generic `convolution` function, which extends the interface of this function with a `dilation_rate` parameter. Args: input: Rank N+2 tensor of type T of

(
    input,  # pylint: disable=redefined-builtin
    filter,  # pylint: disable=redefined-builtin
    padding,
    data_format=None,  # pylint: disable=redefined-builtin
    strides=None,
    name=None)

Source from the content-addressed store, hash-verified

84
85
86def _non_atrous_convolution(
87 input, # pylint: disable=redefined-builtin
88 filter, # pylint: disable=redefined-builtin
89 padding,
90 data_format=None, # pylint: disable=redefined-builtin
91 strides=None,
92 name=None):
93 """Computes sums of N-D convolutions (actually cross correlation).
94
95 It is required that 1 <= N <= 3.
96
97 This is used to implement the more generic `convolution` function, which
98 extends the interface of this function with a `dilation_rate` parameter.
99
100 Args:
101
102 input: Rank N+2 tensor of type T of shape
103 `[batch_size] + input_spatial_shape + [in_channels]` if `data_format`
104 does not start with `"NC"`, or
105 `[batch_size, in_channels] + input_spatial_shape` if `data_format` starts
106 with `"NC"`.
107 filter: Rank N+2 tensor of type T of shape
108 `filter_spatial_shape + [in_channels, out_channels]`. Rank of either
109 `input` or `filter` must be known.
110 padding: Padding method to use, must be either "VALID" or "SAME".
111 data_format: A string or None. Specifies whether the channel dimension of
112 the `input` and output is the last dimension (default, or if `data_format`
113 does not start with "NC"), or the second dimension (if `data_format`
114 starts with "NC"). For N=1, the valid values are "NWC" (default) and
115 "NCW". For N=2, the valid values are "NHWC" (default) and "NCHW".
116 For N=3, the valid values are "NDHWC" (default) and "NCDHW".
117 strides: Sequence of N positive integers, defaults to `[1] * N`.
118 name: Name prefix to use.
119
120 Returns:
121 Rank N+2 tensor of type T of shape
122 `[batch_size] + output_spatial_shape + [out_channels]`, where
123 if padding == "SAME":
124 output_spatial_shape = input_spatial_shape
125 if padding == "VALID":
126 output_spatial_shape = input_spatial_shape - filter_spatial_shape + 1.
127
128 Raises:
129 ValueError: if ranks are incompatible.
130
131 """
132 with ops.name_scope(name, "non_atrous_convolution", [input, filter]) as scope:
133 input = ops.convert_to_tensor(input, name="input") # pylint: disable=redefined-builtin
134 input_shape = input.get_shape()
135 filter = ops.convert_to_tensor(filter, name="filter") # pylint: disable=redefined-builtin
136 filter_shape = filter.get_shape()
137 op = _Convolution(
138 input_shape,
139 filter_shape=filter_shape,
140 padding=padding,
141 data_format=data_format,
142 strides=strides,
143 name=scope)

Callers

nothing calls this directly

Calls 4

_ConvolutionClass · 0.85
opFunction · 0.70
name_scopeMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected