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 { Tensor4D, Tensor5D } from '../tensor';
|
18 | import { TensorLike } from '../types';
|
19 | /**
|
20 | * Computes the 3D average pooling.
|
21 | *
|
22 | * ```js
|
23 | * const x = tf.tensor5d([1, 2, 3, 4, 5, 6, 7, 8], [1, 2, 2, 2, 1]);
|
24 | * const result = tf.avgPool3d(x, 2, 1, 'valid');
|
25 | * result.print();
|
26 | * ```
|
27 | *
|
28 | * @param x The input tensor, of rank 5 or rank 4 of shape
|
29 | * `[batch, depth, height, width, inChannels]`.
|
30 | * @param filterSize The filter size:
|
31 | * `[filterDepth, filterHeight, filterWidth]`.
|
32 | * If `filterSize` is a single number,
|
33 | * then `filterDepth == filterHeight == filterWidth`.
|
34 | * @param strides The strides of the pooling:
|
35 | * `[strideDepth, strideHeight, strideWidth]`.
|
36 | * If `strides` is a single number,
|
37 | * then `strideDepth == strideHeight == strideWidth`.
|
38 | * @param pad The type of padding algorithm.
|
39 | * - `same` and stride 1: output will be of same size as input,
|
40 | * regardless of filter size.
|
41 | * - `valid`: output will be smaller than input if filter is larger
|
42 | * than 1*1x1.
|
43 | * - For more info, see this guide:
|
44 | * [https://www.tensorflow.org/api_guides/python/nn#Convolution](
|
45 | * https://www.tensorflow.org/api_guides/python/nn#Convolution)
|
46 | * @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is
|
47 | * provided, it will default to truncate.
|
48 | * @param dataFormat An optional string from: "NDHWC", "NCDHW". Defaults to
|
49 | * "NDHWC". Specify the data format of the input and output data. With the
|
50 | * default format "NDHWC", the data is stored in the order of: [batch,
|
51 | * depth, height, width, channels]. Only "NDHWC" is currently supported.
|
52 | *
|
53 | * @doc {heading: 'Operations', subheading: 'Convolution'}
|
54 | */
|
55 | declare function avgPool3d_<T extends Tensor4D | Tensor5D>(x: T | TensorLike, filterSize: [number, number, number] | number, strides: [number, number, number] | number, pad: 'valid' | 'same' | number, dimRoundingMode?: 'floor' | 'round' | 'ceil', dataFormat?: 'NDHWC' | 'NCDHW'): T;
|
56 | export declare const avgPool3d: typeof avgPool3d_;
|
57 | export {};
|