UNPKG

2.07 kBTypeScriptView Raw
1import { Tensor4D, Tensor5D } from '../tensor';
2import { TensorLike } from '../types';
3/**
4 * Computes a 3D convolution over the input x.
5 *
6 * @param x The input tensor, of rank 5 or rank 4, of shape
7 * `[batch, depth, height, width, channels]`. If rank 4,
8 * batch of 1 is assumed.
9 * @param filter The filter, rank 5, of shape
10 * `[filterDepth, filterHeight, filterWidth, inChannels, outChannels]`.
11 * inChannels must match between input and filter.
12 * @param strides The strides of the convolution: `[strideDepth, strideHeight,
13 * strideWidth]`.
14 * @param pad The type of padding algorithm.
15 * - `same` and stride 1: output will be of same size as input,
16 * regardless of filter size.
17 * - `valid`: output will be smaller than input if filter is larger
18 * than 1x1.
19 * - For more info, see this guide:
20 * [https://www.tensorflow.org/api_guides/python/nn#Convolution](
21 * https://www.tensorflow.org/api_guides/python/nn#Convolution)
22 * @param dataFormat: An optional string from: "NDHWC", "NCDHW". Defaults to
23 * "NDHWC". Specify the data format of the input and output data. With the
24 * default format "NDHWC", the data is stored in the order of: [batch,
25 * depth, height, width, channels]. Only "NDHWC" is currently supported.
26 * @param dilations The dilation rates: `[dilationDepth, dilationHeight,
27 * dilationWidth]` in which we sample input values across the height
28 * and width dimensions in atrous convolution. Defaults to `[1, 1, 1]`.
29 * If `dilations` is a single number, then
30 * `dilationDepth == dilationHeight == dilationWidth`. If it is greater
31 * than 1, then all values of `strides` must be 1.
32 *
33 * @doc {heading: 'Operations', subheading: 'Convolution'}
34 */
35declare function conv3d_<T extends Tensor4D | Tensor5D>(x: T | TensorLike, filter: Tensor5D | TensorLike, strides: [number, number, number] | number, pad: 'valid' | 'same', dataFormat?: 'NDHWC' | 'NCDHW', dilations?: [number, number, number] | number): T;
36export declare const conv3d: typeof conv3d_;
37export {};