UNPKG

2.78 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2020 Google LLC. All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 * =============================================================================
16 */
17/// <amd-module name="@tensorflow/tfjs-core/dist/ops/dilation2d" />
18import { Tensor3D, Tensor4D } from '../tensor';
19import { TensorLike } from '../types';
20/**
21 * Computes the grayscale dilation over the input `x`.
22 *
23 * @param x The input tensor, rank 3 or rank 4 of shape
24 * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
25 * @param filter The filter tensor, rank 3, of shape
26 * `[filterHeight, filterWidth, depth]`.
27 * @param strides The strides of the sliding window for each dimension of the
28 * input tensor: `[strideHeight, strideWidth]`.
29 * If `strides` is a single number,
30 * then `strideHeight == strideWidth`.
31 * @param pad The type of padding algorithm.
32 * - `same` and stride 1: output will be of same size as input,
33 * regardless of filter size.
34 * - `valid`: output will be smaller than input if filter is larger
35 * than 1*1x1.
36 * - For more info, see this guide:
37 * [https://www.tensorflow.org/api_docs/python/tf/nn/convolution](
38 * https://www.tensorflow.org/api_docs/python/tf/nn/convolution)
39 * @param dataFormat Specify the data format of the input and output data.
40 * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the
41 * default format "NHWC", the data is stored in the order of: [batch,
42 * height, width, channels].
43 * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`
44 * in which we sample input values across the height and width dimensions
45 * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`
46 * is a single number, then `dilationHeight == dilationWidth`. If it is
47 * greater than 1, then all values of `strides` must be 1.
48 *
49 * @doc {heading: 'Operations', subheading: 'Convolution'}
50 */
51declare function dilation2d_<T extends Tensor3D | Tensor4D>(x: T | TensorLike, filter: Tensor3D | TensorLike, strides: [number, number] | number, pad: 'valid' | 'same', dilations?: [number, number] | number, dataFormat?: 'NHWC'): T;
52export declare const dilation2d: typeof dilation2d_;
53export {};