UNPKG

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