tf.conv
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Computes a N-D convolution given (N+1+batch_dims)-D input and (N+2)-D filter tensors.
tf.conv(
    input: Annotated[Any, TV_Conv_T],
    filter: Annotated[Any, TV_Conv_T],
    strides,
    padding: str,
    explicit_paddings=[],
    data_format: str = 'CHANNELS_LAST',
    dilations=[],
    batch_dims: int = 1,
    groups: int = 1,
    name=None
) -> Annotated[Any, TV_Conv_T]
General function for computing a N-D convolution. It is required that
1 <= N <= 3.
| Args | 
|---|
| input | A Tensor. Must be one of the following types:half,bfloat16,float32,float64,int32.
Tensor of type T and shapebatch_shape + spatial_shape + [in_channels]in the
case thatchannels_last_format = trueor shapebatch_shape + [in_channels] + spatial_shapeifchannels_last_format = false.
spatial_shape is N-dimensional withN=2orN=3.
Also note thatbatch_shapeis dictated by the parameterbatch_dimsand defaults to 1. | 
| filter | A Tensor. Must have the same type asinput.
An(N+2)-DTensor with the same type asinputand shapespatial_filter_shape + [in_channels, out_channels], where spatial_filter_shape
is N-dimensional withN=2orN=3. | 
| strides | A list of ints.
1-D tensor of lengthN+2. The stride of the sliding window for each
dimension ofinput. Must havestrides[0] = strides[N+1] = 1. | 
| padding | A stringfrom:"SAME", "VALID", "EXPLICIT".
The type of padding algorithm to use. | 
| explicit_paddings | An optional list of ints. Defaults to[].
Ifpaddingis"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. Ifpaddingis not"EXPLICIT",explicit_paddingsmust be empty. | 
| data_format | An optional stringfrom:"CHANNELS_FIRST", "CHANNELS_LAST". Defaults to"CHANNELS_LAST".
Used to set the data format. By defaultCHANNELS_FIRST, usesNHWC (2D) / NDHWC (3D)or ifCHANNELS_LAST, usesNCHW (2D) / NCDHW (3D). | 
| dilations | An optional list of ints. Defaults to[].
1-D tensor of lengthN+2. The dilation factor for each dimension ofinput. If set tok > 1, there will bek-1skipped 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 | An optional int. Defaults to1.
A positive integer specifying the number of batch dimensions for the input
tensor. Should be less than the rank of the input tensor. | 
| groups | An optional int. Defaults to1.
A positive integer specifying the number of groups in which the input is split
along the channel axis. Each group is convolved separately withfilters / groupsfilters. The output is the concatenation of all the groups
results along the channel axis. Input channels and filters must both be
divisible by groups. | 
| name | A name for the operation (optional). | 
| Returns | 
|---|
| A Tensor. Has the same type asinput. | 
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
  Last updated 2024-04-26 UTC.
  
  
  
    
      [null,null,["Last updated 2024-04-26 UTC."],[],[]]