# Conv

public final class **Conv** Computes a N-D convolution given (N+1+batch_dims)-D \`input\` and (N+2)-D \`filter\` tensors.


General function for computing a N-D convolution. It is required that
\`1 \<= N \<= 3\`.

<br />

### Nested Classes

|---|---|---|---|
| class | [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) || Optional attributes for `https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv` |

### Public Methods

|---|---|
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [asOutput](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#asOutput())() Returns the symbolic handle of a tensor. |
| static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) | [batchDims](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#batchDims(java.lang.Long))(Long batchDims) |
| static \<T extends Number\> [Conv](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv)\<T\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20java.util.List<java.lang.Long>,%20java.lang.String,%20org.tensorflow.op.core.Conv.Options...))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> input, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> filter, List\<Long\> strides, String padding, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) options) Factory method to create a class wrapping a new Conv operation. |
| static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) | [dataFormat](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#dataFormat(java.lang.String))(String dataFormat) |
| static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) | [dilations](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#dilations(java.util.List<java.lang.Long>))(List\<Long\> dilations) |
| static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) | [explicitPaddings](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#explicitPaddings(java.util.List<java.lang.Long>))(List\<Long\> explicitPaddings) |
| static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) | [groups](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#groups(java.lang.Long))(Long groups) |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [output](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv#output())() A (N+1+batch_dims)-D tensor. |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface [org.tensorflow.Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)

|---|---|
| abstract [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [asOutput](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand#asOutput())() Returns the symbolic handle of a tensor. |

## Public Methods

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**asOutput**
()

Returns the symbolic handle of a tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is
used to obtain a symbolic handle that represents the computation of the input.

<br />

#### public static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options)
**batchDims**
(Long batchDims)

<br />

##### Parameters

| batchDims | A positive integer specifying the number of batch dimensions for the input tensor. Should be less than the rank of the input tensor. |
|---|---|

#### public static [Conv](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv)\<T\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> input, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> filter, List\<Long\> strides, String padding, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options) options)

Factory method to create a class wrapping a new Conv operation.

##### Parameters

| scope | current scope |
| input | Tensor of type T and shape \`batch_shape + spatial_shape + \[in_channels\]\` in the case that \`channels_last_format = true\` or shape \`batch_shape + \[in_channels\] + spatial_shape\` if \`channels_last_format = false\`. spatial_shape is N-dimensional with \`N=2\` or \`N=3\`. Also note that \`batch_shape\` is dictated by the parameter \`batch_dims\` and defaults to 1. |
| filter | An \`(N+2)-D\` Tensor with the same type as \`input\` and shape \`spatial_filter_shape + \[in_channels, out_channels\]\`, where spatial_filter_shape is N-dimensional with \`N=2\` or \`N=3\`. |
| strides | 1-D tensor of length \`N+2\`. The stride of the sliding window for each dimension of \`input\`. Must have \`strides\[0\] = strides\[N+1\] = 1\`. |
| padding | The type of padding algorithm to use. |
| options | carries optional attributes values |
|---|---|

##### Returns

- a new instance of Conv

#### public static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options)
**dataFormat**
(String dataFormat)

<br />

##### Parameters

| dataFormat | Used to set the data format. By default \`CHANNELS_FIRST\`, uses \`NHWC (2D) / NDHWC (3D)\` or if \`CHANNELS_LAST\`, uses \`NCHW (2D) / NCDHW (3D)\`. |
|---|---|

#### public static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options)
**dilations**
(List\<Long\> dilations)

<br />

##### Parameters

| dilations | 1-D tensor of length \`N+2\`. The dilation factor for each dimension of \`input\`. If set to \`k \> 1\`, there will be \`k-1\` skipped cells between each filter element on that dimension. The dimension order is determined by the value of \`channels_last_format\`, see above for details. Dilations in the batch and depth dimensions must be 1. |
|---|---|

#### public static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options)
**explicitPaddings**
(List\<Long\> explicitPaddings)

<br />

##### Parameters

| explicitPaddings | If \`padding\` is \`"EXPLICIT"\`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is \`explicit_paddings\[2 \* i\]\` and \`explicit_paddings\[2 \* i + 1\]\`, respectively. If \`padding\` is not \`"EXPLICIT"\`, \`explicit_paddings\` must be empty. |
|---|---|

#### public static [Conv.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/Conv.Options)
**groups**
(Long groups)

<br />

##### Parameters

| 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. |
|---|---|

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**output**
()

A (N+1+batch_dims)-D tensor. The dimension order is determined by the value of
\`channels_last_format\`, see below for details.