Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/keras/src/layers/rnn/__init__.py: 72%
43 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 07:57 +0000
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-03 07:57 +0000
1# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# ==============================================================================
15"""Keras recurrent layers."""
17import tensorflow.compat.v2 as tf
19from keras.src.layers.rnn.abstract_rnn_cell import AbstractRNNCell
21# Recurrent layers.
22from keras.src.layers.rnn.base_rnn import RNN
23from keras.src.layers.rnn.simple_rnn import SimpleRNN
24from keras.src.layers.rnn.simple_rnn import SimpleRNNCell
25from keras.src.layers.rnn.stacked_rnn_cells import StackedRNNCells
27if tf.__internal__.tf2.enabled():
28 from keras.src.layers.rnn.gru import GRU
29 from keras.src.layers.rnn.gru import GRUCell
30 from keras.src.layers.rnn.gru_v1 import GRU as GRUV1
31 from keras.src.layers.rnn.gru_v1 import GRUCell as GRUCellV1
32 from keras.src.layers.rnn.lstm import LSTM
33 from keras.src.layers.rnn.lstm import LSTMCell
34 from keras.src.layers.rnn.lstm_v1 import LSTM as LSTMV1
35 from keras.src.layers.rnn.lstm_v1 import LSTMCell as LSTMCellV1
37 GRUV2 = GRU
38 GRUCellV2 = GRUCell
39 LSTMV2 = LSTM
40 LSTMCellV2 = LSTMCell
41else:
42 from keras.src.layers.rnn.gru import GRU as GRUV2
43 from keras.src.layers.rnn.gru import GRUCell as GRUCellV2
44 from keras.src.layers.rnn.gru_v1 import GRU
45 from keras.src.layers.rnn.gru_v1 import GRUCell
46 from keras.src.layers.rnn.lstm import LSTM as LSTMV2
47 from keras.src.layers.rnn.lstm import LSTMCell as LSTMCellV2
48 from keras.src.layers.rnn.lstm_v1 import LSTM
49 from keras.src.layers.rnn.lstm_v1 import LSTMCell
51 GRUV1 = GRU
52 GRUCellV1 = GRUCell
53 LSTMV1 = LSTM
54 LSTMCellV1 = LSTMCell
56# Wrapper functions.
57from keras.src.layers.rnn.base_wrapper import Wrapper
58from keras.src.layers.rnn.bidirectional import Bidirectional
60# RNN Cell wrappers.
61from keras.src.layers.rnn.cell_wrappers import DeviceWrapper
62from keras.src.layers.rnn.cell_wrappers import DropoutWrapper
63from keras.src.layers.rnn.cell_wrappers import ResidualWrapper
65# Convolutional-recurrent layers.
66from keras.src.layers.rnn.conv_lstm1d import ConvLSTM1D
67from keras.src.layers.rnn.conv_lstm2d import ConvLSTM2D
68from keras.src.layers.rnn.conv_lstm3d import ConvLSTM3D
69from keras.src.layers.rnn.cudnn_gru import CuDNNGRU
71# cuDNN recurrent layers.
72from keras.src.layers.rnn.cudnn_lstm import CuDNNLSTM
73from keras.src.layers.rnn.time_distributed import TimeDistributed