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 | import { Tensor3D, Tensor4D } from '../tensor';
|
18 | import { TensorLike } from '../types';
|
19 | /**
|
20 | * Computes the grayscale dilation over the input `x`.
|
21 | *
|
22 | * @param x The input tensor, rank 3 or rank 4 of shape
|
23 | * `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
|
24 | * @param filter The filter tensor, rank 3, of shape
|
25 | * `[filterHeight, filterWidth, depth]`.
|
26 | * @param strides The strides of the sliding window for each dimension of the
|
27 | * input tensor: `[strideHeight, strideWidth]`.
|
28 | * If `strides` is a single number,
|
29 | * then `strideHeight == strideWidth`.
|
30 | * @param pad The type of padding algorithm.
|
31 | * - `same` and stride 1: output will be of same size as input,
|
32 | * regardless of filter size.
|
33 | * - `valid`: output will be smaller than input if filter is larger
|
34 | * than 1*1x1.
|
35 | * - For more info, see this guide:
|
36 | * [https://www.tensorflow.org/api_guides/python/nn#Convolution](
|
37 | * https://www.tensorflow.org/api_guides/python/nn#Convolution)
|
38 | * @param dataFormat Specify the data format of the input and output data.
|
39 | * Defaults to 'NHWC'. Only 'NHWC' is currently supported. With the
|
40 | * default format "NHWC", the data is stored in the order of: [batch,
|
41 | * height, width, channels].
|
42 | * @param dilations The dilation rates: `[dilationHeight, dilationWidth]`
|
43 | * in which we sample input values across the height and width dimensions
|
44 | * for atrous morphological dilation. Defaults to `[1, 1]`. If `dilations`
|
45 | * is a single number, then `dilationHeight == dilationWidth`. If it is
|
46 | * greater than 1, then all values of `strides` must be 1.
|
47 | *
|
48 | * @doc {heading: 'Operations', subheading: 'Convolution'}
|
49 | */
|
50 | declare 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;
|
51 | export declare const dilation2d: typeof dilation2d_;
|
52 | export {};
|