class_docstr: {rank}D convolution layer.
  
  This layer creates a filter kernel that is convolved or cross correlated with
  the layer input to produce an output tensor. The main difference of this class
  to `tf.layers.Conv{rank}D` is how padding, up- and downsampling, and alignment
  is handled. It supports much more flexible options for structuring the linear
  transform.
  
  In general, the outputs are equivalent to a composition of:
  1. an upsampling step (if `strides_up > 1`)
  2. a convolution or cross correlation
  3. a downsampling step (if `strides_down > 1`)
  4. addition of a bias vector (if `use_bias == True`)
  5. a pointwise nonlinearity (if `activation is not None`)
  
  For more information on what the difference between convolution and cross
  correlation is, see [this](https://en.wikipedia.org/wiki/Convolution) and
  [this](https://en.wikipedia.org/wiki/Cross-correlation) Wikipedia article,
  respectively. Note that the distinction between convolution and cross
  correlation is occasionally blurred (one may use convolution as an umbrella
  term for both). For a discussion of up-/downsampling, refer to the articles
  about [upsampling](https://en.wikipedia.org/wiki/Upsampling) and
  [decimation](https://en.wikipedia.org/wiki/Decimation_(signal_processing)). A
  more in-depth treatment of all of these operations can be found in:
  
  > "Discrete-Time Signal Processing"<br />
  > Oppenheim, Schafer, Buck (Prentice Hall)
  
  For purposes of this class, the center position of a kernel is always
  considered to be at `K // 2`, where `K` is the support length of the kernel.
  This implies that in the `'same_*'` padding modes, all of the following
  operations will produce the same result if applied to the same inputs, which
  is not generally true for convolution operations as implemented by
  `tf.nn.convolution` or `tf.layers.Conv?D` (numbers represent kernel
  coefficient values):
  
  - convolve with `[1, 2, 3]`
  - convolve with `[0, 1, 2, 3, 0]`
  - convolve with `[0, 1, 2, 3]`
  - correlate with `[3, 2, 1]`
  - correlate with `[0, 3, 2, 1, 0]`
  - correlate with `[0, 3, 2, 1]`
  
  Available padding (boundary handling) modes:
  
  - `'valid'`: This always yields the maximum number of output samples that can
    be computed without making any assumptions about the values outside of the
    support of the input tensor. The padding semantics are always applied to the
    inputs. In contrast, even though `tf.nn.conv2d_transpose` implements
    upsampling, in `'VALID'` mode it will produce an output tensor with *larger*
    support than the input tensor (because it is the transpose of a `'VALID'`
    downsampled convolution).
  
    Examples (numbers represent indexes into the respective tensors, periods
    represent skipped spatial positions):
  
    `kernel_support = 5` and `strides_down = 2`:
    ```
    inputs:  |0 1 2 3 4 5 6 7 8|
    outputs: |    0 . 1 . 2    |
    ```
  
    ```
    inputs:  |0 1 2 3 4 5 6 7|
    outputs: |    0 . 1 .    |
    ```
  
    `kernel_support = 3`, `strides_up = 2`, and `extra_pad_end = True`:
    ```
    inputs:   |0 . 1 . 2 . 3 . 4 .|
    outputs:  |  0 1 2 3 4 5 6 7  |
    ```
  
    `kernel_support = 3`, `strides_up = 2`, and `extra_pad_end = False`:
    ```
    inputs:   |0 . 1 . 2 . 3 . 4|
    outputs:  |  0 1 2 3 4 5 6  |
    ```
  
  - `'same_zeros'`: Values outside of the input tensor support are assumed to be
    zero. Similar to `'SAME'` in `tf.nn.convolution`, but with different
    padding. In `'SAME'`, the spatial alignment of the output depends on the
    input shape. Here, the output alignment depends only on the kernel support
    and the strides, making alignment more predictable. The first sample in the
    output is always spatially aligned with the first sample in the input.
  
    Examples (numbers represent indexes into the respective tensors, periods
    represent skipped spatial positions):
  
    `kernel_support = 5` and `strides_down = 2`:
    ```
    inputs:  |0 1 2 3 4 5 6 7 8|
    outputs: |0 . 1 . 2 . 3 . 4|
    ```
  
    ```
    inputs:  |0 1 2 3 4 5 6 7|
    outputs: |0 . 1 . 2 . 3 .|
    ```
  
    `kernel_support = 3`, `strides_up = 2`, and `extra_pad_end = True`:
    ```
    inputs:   |0 . 1 . 2 . 3 . 4 .|
    outputs:  |0 1 2 3 4 5 6 7 8 9|
    ```
  
    `kernel_support = 3`, `strides_up = 2`, and `extra_pad_end = False`:
    ```
    inputs:   |0 . 1 . 2 . 3 . 4|
    outputs:  |0 1 2 3 4 5 6 7 8|
    ```
  
  - `'same_reflect'`: Values outside of the input tensor support are assumed to
    be reflections of the samples inside. Note that this is the same padding as
    implemented by `tf.pad` in the `'REFLECT'` mode (i.e. with the symmetry axis
    on the samples rather than between). The output alignment is identical to
    the `'same_zeros'` mode.
  
    Examples: see `'same_zeros'`.
  
    When applying several convolutions with down- or upsampling in a sequence,
    it can be helpful to keep the axis of symmetry for the reflections
    consistent. To do this, set `extra_pad_end = False` and make sure that the
    input has length `M`, such that `M % S == 1`, where `S` is the product of
    stride lengths of all subsequent convolutions. Example for subsequent
    downsampling (here, `M = 9`, `S = 4`, and `^` indicate the symmetry axes
    for reflection):
  
    ```
    inputs:       |0 1 2 3 4 5 6 7 8|
    intermediate: |0 . 1 . 2 . 3 . 4|
    outputs:      |0 . . . 1 . . . 2|
                   ^               ^
    ```
  
  Note that due to limitations of the underlying operations, not all
  combinations of arguments are currently implemented. In this case, this class
  will throw a `NotImplementedError` exception.
  
  Speed tips:
  
  - Prefer combining correlations with downsampling, and convolutions with
    upsampling, as the underlying ops implement these combinations directly.
  - If that isn't desirable, prefer using odd-length kernel supports, since
    odd-length kernels can be flipped if necessary, to use the fastest
    implementation available.
  - Combining upsampling and downsampling (for rational resampling ratios)
    is relatively slow, because no underlying ops exist for that use case.
    Downsampling in this case is implemented by discarding computed output
    values.
  - Note that `channel_separable` is only implemented for 1D and 2D. Also,
    upsampled channel-separable convolutions are currently only implemented for
    `filters == 1`. When using `channel_separable`, prefer using identical
    strides in all dimensions to maximize performance.
  
  Attributes:
    filters: Integer. If `not channel_separable`, specifies the total number of
      filters, which is equal to the number of output channels. Otherwise,
      specifies the number of filters per channel, which makes the number of
      output channels equal to `filters` times the number of input channels.
    kernel_support: An integer or iterable of {rank} integers, specifying the
      length of the convolution/correlation window in each dimension.
    corr: Boolean. If True, compute cross correlation. If False, convolution.
    strides_down: An integer or iterable of {rank} integers, specifying an
      optional downsampling stride after the convolution/correlation.
    strides_up: An integer or iterable of {rank} integers, specifying an
      optional upsampling stride before the convolution/correlation.
    padding: String. One of the supported padding modes (see above).
    extra_pad_end: Boolean or `None`. When upsampling, use extra skipped samples
      at the end of each dimension. `None` implies `True` for `same_*` padding
      modes, and `False` for `valid`. For examples, refer to the discussion of
      padding modes above.
    channel_separable: Boolean. If `False`, each output channel is computed by
      summing over all filtered input channels. If `True`, each output channel
      is computed from only one input channel, and `filters` specifies the
      number of filters per channel. The output channels are ordered such that
      the first block of `filters` channels is computed from the first input
      channel, the second block from the second input channel, etc.
    data_format: String, one of `'channels_last'` or `'channels_first'`. The
      ordering of the input dimensions. `'channels_last'` corresponds to input
      tensors with shape `(batch, ..., channels)`, while `'channels_first'`
      corresponds to input tensors with shape `(batch, channels, ...)`.
    activation: Activation function or `None`.
    use_bias: Boolean, whether an additive constant will be applied to each
      output channel.
    use_explicit: Boolean, whether to use `EXPLICIT` padding mode (supported in
      TensorFlow >1.14).
    kernel_parameter: Tensor, `tf.Variable`, callable, or one of the strings
      `'rdft'`, `'variable'`. A `tf.Tensor` means that the kernel is fixed, a
      `tf.Variable` that it is trained. A callable can be used to determine the
      value of the kernel as a function of some other variable or tensor. This
      can be a `Parameter` object. `'rdft'` means that when the layer is built,
      a `RDFTParameter` object is created to train the kernel. `'variable'`
      means that when the layer is built, a `tf.Variable` is created to train
      the kernel. Note that certain choices here such as `tf.Tensor`s or lambda
      functions may prevent JSON-style serialization (`Parameter` objects and
      `tf.Variable`s work).
    bias_parameter: Tensor, `tf.Variable`, callable, or the string `'variable'`.
      A `tf.Tensor` means that the bias is fixed, a `tf.Variable` that it is
      trained. A callable can be used to determine the value of the bias as a
      function of some other variable or tensor. This can be a `Parameter`
      object. `'variable'` means that when the layer is built, a `tf.Variable`
      is created to train the bias. Note that certain choices here such as
      `tf.Tensor`s or lambda functions may prevent JSON-style serialization
      (`Parameter` objects and `tf.Variable`s work).
    kernel_initializer: `Initializer` object for the filter kernel.
    bias_initializer: `Initializer` object for the bias vector.
    kernel_regularizer: `Regularizer` object or `None`. Optional regularizer for
      the filter kernel.
    bias_regularizer: `Regularizer` object or `None`. Optional regularizer for
      the bias vector.
    kernel: `tf.Tensor`. Read-only property always returning the current kernel
      tensor.
    bias: `tf.Tensor`. Read-only property always returning the current bias
      tensor.
class_docstr_tok: ["{","rank","}","D","convolution","layer",".","This","layer","creates","a","filter","kernel","that","is","convolved","or","cross","correlated","with","the","layer","input","to","produce","an","output","tensor",".","The","main","difference","of","this","class","to","`","tf.layers.Conv","{","rank","}","D","`","is","how","padding",",","up-","and","downsampling",",","and","alignment","is","handled",".","It","supports","much","more","flexible","options","for","structuring","the","linear","transform",".","In","general",",","the","outputs","are","equivalent","to","a","composition","of",":","1.","an","upsampling","step","(","if","`","strides_up",">","1","`",")","2.","a","convolution","or","cross","correlation","3.","a","downsampling","step","(","if","`","strides_down",">","1","`",")","4.","addition","of","a","bias","vector","(","if","`","use_bias","==","True","`",")","5.","a","pointwise","nonlinearity","(","if","`","activation","is","not","None","`",")","For","more","information","on","what","the","difference","between","convolution","and","cross","correlation","is",",","see","[","this","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Convolution",")","and","[","this","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Cross-correlation",")","Wikipedia","article",",","respectively",".","Note","that","the","distinction","between","convolution","and","cross","correlation","is","occasionally","blurred","(","one","may","use","convolution","as","an","umbrella","term","for","both",")",".","For","a","discussion","of","up-\/downsampling",",","refer","to","the","articles","about","[","upsampling","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Upsampling",")","and","[","decimation","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Decimation_","(","signal_processing",")",")",".","A","more","in-depth","treatment","of","all","of","these","operations","can","be","found","in",":",">","``","Discrete-Time","Signal","Processing","''","<","br","\/",">",">","Oppenheim",",","Schafer",",","Buck","(","Prentice","Hall",")","For","purposes","of","this","class",",","the","center","position","of","a","kernel","is","always","considered","to","be","at","`","K","\/\/","2","`",",","where","`","K","`","is","the","support","length","of","the","kernel",".","This","implies","that","in","the","`","'same_","*","'","`","padding","modes",",","all","of","the","following","operations","will","produce","the","same","result","if","applied","to","the","same","inputs",",","which","is","not","generally","true","for","convolution","operations","as","implemented","by","`","tf.nn.convolution","`","or","`","tf.layers.Conv","?","D","`","(","numbers","represent","kernel","coefficient","values",")",":","-","convolve","with","`","[","1",",","2",",","3","]","`","-","convolve","with","`","[","0",",","1",",","2",",","3",",","0","]","`","-","convolve","with","`","[","0",",","1",",","2",",","3","]","`","-","correlate","with","`","[","3",",","2",",","1","]","`","-","correlate","with","`","[","0",",","3",",","2",",","1",",","0","]","`","-","correlate","with","`","[","0",",","3",",","2",",","1","]","`","Available","padding","(","boundary","handling",")","modes",":","-","`","'valid","'","`",":","This","always","yields","the","maximum","number","of","output","samples","that","can","be","computed","without","making","any","assumptions","about","the","values","outside","of","the","support","of","the","input","tensor",".","The","padding","semantics","are","always","applied","to","the","inputs",".","In","contrast",",","even","though","`","tf.nn.conv2d_transpose","`","implements","upsampling",",","in","`","'VALID","'","`","mode","it","will","produce","an","output","tensor","with","*","larger","*","support","than","the","input","tensor","(","because","it","is","the","transpose","of","a","`","'VALID","'","`","downsampled","convolution",")",".","Examples","(","numbers","represent","indexes","into","the","respective","tensors",",","periods","represent","skipped","spatial","positions",")",":","`","kernel_support","=","5","`","and","`","strides_down","=","2","`",":","``","`","inputs",":","|0","1","2","3","4","5","6","7","8|","outputs",":","|","0",".","1",".","2","|","``","`","``","`","inputs",":","|0","1","2","3","4","5","6","7|","outputs",":","|","0",".","1",".","|","``","`","`","kernel_support","=","3","`",",","`","strides_up","=","2","`",",","and","`","extra_pad_end","=","True","`",":","``","`","inputs",":","|0",".","1",".","2",".","3",".","4",".|","outputs",":","|","0","1","2","3","4","5","6","7","|","``","`","`","kernel_support","=","3","`",",","`","strides_up","=","2","`",",","and","`","extra_pad_end","=","False","`",":","``","`","inputs",":","|0",".","1",".","2",".","3",".","4|","outputs",":","|","0","1","2","3","4","5","6","|","``","`","-","`","'same_zeros","'","`",":","Values","outside","of","the","input","tensor","support","are","assumed","to","be","zero",".","Similar","to","`","'SAME","'","`","in","`","tf.nn.convolution","`",",","but","with","different","padding",".","In","`","'SAME","'","`",",","the","spatial","alignment","of","the","output","depends","on","the","input","shape",".","Here",",","the","output","alignment","depends","only","on","the","kernel","support","and","the","strides",",","making","alignment","more","predictable",".","The","first","sample","in","the","output","is","always","spatially","aligned","with","the","first","sample","in","the","input",".","Examples","(","numbers","represent","indexes","into","the","respective","tensors",",","periods","represent","skipped","spatial","positions",")",":","`","kernel_support","=","5","`","and","`","strides_down","=","2","`",":","``","`","inputs",":","|0","1","2","3","4","5","6","7","8|","outputs",":","|0",".","1",".","2",".","3",".","4|","``","`","``","`","inputs",":","|0","1","2","3","4","5","6","7|","outputs",":","|0",".","1",".","2",".","3",".|","``","`","`","kernel_support","=","3","`",",","`","strides_up","=","2","`",",","and","`","extra_pad_end","=","True","`",":","``","`","inputs",":","|0",".","1",".","2",".","3",".","4",".|","outputs",":","|0","1","2","3","4","5","6","7","8","9|","``","`","`","kernel_support","=","3","`",",","`","strides_up","=","2","`",",","and","`","extra_pad_end","=","False","`",":","``","`","inputs",":","|0",".","1",".","2",".","3",".","4|","outputs",":","|0","1","2","3","4","5","6","7","8|","``","`","-","`","'same_reflect","'","`",":","Values","outside","of","the","input","tensor","support","are","assumed","to","be","reflections","of","the","samples","inside",".","Note","that","this","is","the","same","padding","as","implemented","by","`","tf.pad","`","in","the","`","'REFLECT","'","`","mode","(","i.e",".","with","the","symmetry","axis","on","the","samples","rather","than","between",")",".","The","output","alignment","is","identical","to","the","`","'same_zeros","'","`","mode",".","Examples",":","see","`","'same_zeros","'","`",".","When","applying","several","convolutions","with","down-","or","upsampling","in","a","sequence",",","it","can","be","helpful","to","keep","the","axis","of","symmetry","for","the","reflections","consistent",".","To","do","this",",","set","`","extra_pad_end","=","False","`","and","make","sure","that","the","input","has","length","`","M","`",",","such","that","`","M","%","S","==","1","`",",","where","`","S","`","is","the","product","of","stride","lengths","of","all","subsequent","convolutions",".","Example","for","subsequent","downsampling","(","here",",","`","M","=","9","`",",","`","S","=","4","`",",","and","`","^","`","indicate","the","symmetry","axes","for","reflection",")",":","``","`","inputs",":","|0","1","2","3","4","5","6","7","8|","intermediate",":","|0",".","1",".","2",".","3",".","4|","outputs",":","|0",".",".",".","1",".",".",".","2|","^","^","``","`","Note","that","due","to","limitations","of","the","underlying","operations",",","not","all","combinations","of","arguments","are","currently","implemented",".","In","this","case",",","this","class","will","throw","a","`","NotImplementedError","`","exception",".","Speed","tips",":","-","Prefer","combining","correlations","with","downsampling",",","and","convolutions","with","upsampling",",","as","the","underlying","ops","implement","these","combinations","directly",".","-","If","that","is","n't","desirable",",","prefer","using","odd-length","kernel","supports",",","since","odd-length","kernels","can","be","flipped","if","necessary",",","to","use","the","fastest","implementation","available",".","-","Combining","upsampling","and","downsampling","(","for","rational","resampling","ratios",")","is","relatively","slow",",","because","no","underlying","ops","exist","for","that","use","case",".","Downsampling","in","this","case","is","implemented","by","discarding","computed","output","values",".","-","Note","that","`","channel_separable","`","is","only","implemented","for","1D","and","2D",".","Also",",","upsampled","channel-separable","convolutions","are","currently","only","implemented","for","`","filters","==","1","`",".","When","using","`","channel_separable","`",",","prefer","using","identical","strides","in","all","dimensions","to","maximize","performance",".","Attributes",":","filters",":","Integer",".","If","`","not","channel_separable","`",",","specifies","the","total","number","of","filters",",","which","is","equal","to","the","number","of","output","channels",".","Otherwise",",","specifies","the","number","of","filters","per","channel",",","which","makes","the","number","of","output","channels","equal","to","`","filters","`","times","the","number","of","input","channels",".","kernel_support",":","An","integer","or","iterable","of","{","rank","}","integers",",","specifying","the","length","of","the","convolution\/correlation","window","in","each","dimension",".","corr",":","Boolean",".","If","True",",","compute","cross","correlation",".","If","False",",","convolution",".","strides_down",":","An","integer","or","iterable","of","{","rank","}","integers",",","specifying","an","optional","downsampling","stride","after","the","convolution\/correlation",".","strides_up",":","An","integer","or","iterable","of","{","rank","}","integers",",","specifying","an","optional","upsampling","stride","before","the","convolution\/correlation",".","padding",":","String",".","One","of","the","supported","padding","modes","(","see","above",")",".","extra_pad_end",":","Boolean","or","`","None","`",".","When","upsampling",",","use","extra","skipped","samples","at","the","end","of","each","dimension",".","`","None","`","implies","`","True","`","for","`","same_","*","`","padding","modes",",","and","`","False","`","for","`","valid","`",".","For","examples",",","refer","to","the","discussion","of","padding","modes","above",".","channel_separable",":","Boolean",".","If","`","False","`",",","each","output","channel","is","computed","by","summing","over","all","filtered","input","channels",".","If","`","True","`",",","each","output","channel","is","computed","from","only","one","input","channel",",","and","`","filters","`","specifies","the","number","of","filters","per","channel",".","The","output","channels","are","ordered","such","that","the","first","block","of","`","filters","`","channels","is","computed","from","the","first","input","channel",",","the","second","block","from","the","second","input","channel",",","etc",".","data_format",":","String",",","one","of","`","'channels_last","'","`","or","`","'channels_first","'","`",".","The","ordering","of","the","input","dimensions",".","`","'channels_last","'","`","corresponds","to","input","tensors","with","shape","`","(","batch",",","...",",","channels",")","`",",","while","`","'channels_first","'","`","corresponds","to","input","tensors","with","shape","`","(","batch",",","channels",",","...",")","`",".","activation",":","Activation","function","or","`","None","`",".","use_bias",":","Boolean",",","whether","an","additive","constant","will","be","applied","to","each","output","channel",".","use_explicit",":","Boolean",",","whether","to","use","`","EXPLICIT","`","padding","mode","(","supported","in","TensorFlow",">","1.14",")",".","kernel_parameter",":","Tensor",",","`","tf.Variable","`",",","callable",",","or","one","of","the","strings","`","'rdft","'","`",",","`","'variable","'","`",".","A","`","tf.Tensor","`","means","that","the","kernel","is","fixed",",","a","`","tf.Variable","`","that","it","is","trained",".","A","callable","can","be","used","to","determine","the","value","of","the","kernel","as","a","function","of","some","other","variable","or","tensor",".","This","can","be","a","`","Parameter","`","object",".","`","'rdft","'","`","means","that","when","the","layer","is","built",",","a","`","RDFTParameter","`","object","is","created","to","train","the","kernel",".","`","'variable","'","`","means","that","when","the","layer","is","built",",","a","`","tf.Variable","`","is","created","to","train","the","kernel",".","Note","that","certain","choices","here","such","as","`","tf.Tensor","`","s","or","lambda","functions","may","prevent","JSON-style","serialization","(","`","Parameter","`","objects","and","`","tf.Variable","`","s","work",")",".","bias_parameter",":","Tensor",",","`","tf.Variable","`",",","callable",",","or","the","string","`","'variable","'","`",".","A","`","tf.Tensor","`","means","that","the","bias","is","fixed",",","a","`","tf.Variable","`","that","it","is","trained",".","A","callable","can","be","used","to","determine","the","value","of","the","bias","as","a","function","of","some","other","variable","or","tensor",".","This","can","be","a","`","Parameter","`","object",".","`","'variable","'","`","means","that","when","the","layer","is","built",",","a","`","tf.Variable","`","is","created","to","train","the","bias",".","Note","that","certain","choices","here","such","as","`","tf.Tensor","`","s","or","lambda","functions","may","prevent","JSON-style","serialization","(","`","Parameter","`","objects","and","`","tf.Variable","`","s","work",")",".","kernel_initializer",":","`","Initializer","`","object","for","the","filter","kernel",".","bias_initializer",":","`","Initializer","`","object","for","the","bias","vector",".","kernel_regularizer",":","`","Regularizer","`","object","or","`","None","`",".","Optional","regularizer","for","the","filter","kernel",".","bias_regularizer",":","`","Regularizer","`","object","or","`","None","`",".","Optional","regularizer","for","the","bias","vector",".","kernel",":","`","tf.Tensor","`",".","Read-only","property","always","returning","the","current","kernel","tensor",".","bias",":","`","tf.Tensor","`",".","Read-only","property","always","returning","the","current","bias","tensor","."]
code: def activation(self) -> Optional[Callable[[Any], tf.Tensor]]:
      return self._activation
  
imports: from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Union
  import tensorflow
  from tensorflow_compression.python.layers import parameters
  from tensorflow_compression.python.ops import padding_ops
label_desc: Use image node_id 20 for calling the _SignalConv obj's underlying member method code with example usage: obj.activation() and returns: self