UNPKG

1.75 kBTypeScriptView Raw
1/// <amd-module name="@tensorflow/tfjs-core/dist/ops/multi_rnn_cell" />
2/**
3 * @license
4 * Copyright 2020 Google LLC. All Rights Reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * =============================================================================
17 */
18import { Tensor2D } from '../tensor';
19import { TensorLike } from '../types';
20/**
21 * @docalias (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D]
22 */
23export declare type LSTMCellFunc = {
24 (data: Tensor2D, c: Tensor2D, h: Tensor2D): [Tensor2D, Tensor2D];
25};
26/**
27 * Computes the next states and outputs of a stack of LSTMCells.
28 *
29 * Each cell output is used as input to the next cell.
30 *
31 * Returns `[cellState, cellOutput]`.
32 *
33 * Derived from tf.contrib.rn.MultiRNNCell.
34 *
35 * @param lstmCells Array of LSTMCell functions.
36 * @param data The input to the cell.
37 * @param c Array of previous cell states.
38 * @param h Array of previous cell outputs.
39 *
40 * @doc {heading: 'Operations', subheading: 'RNN'}
41 */
42declare function multiRNNCell_(lstmCells: LSTMCellFunc[], data: Tensor2D | TensorLike, c: Array<Tensor2D | TensorLike>, h: Array<Tensor2D | TensorLike>): [Tensor2D[], Tensor2D[]];
43export declare const multiRNNCell: typeof multiRNNCell_;
44export {};