def _create_cells(self) -> List[MultiRNNCell]:
"""
Creates the multilayer-RNN cells required by the architecture of this RNN.
Returns
-------
list of MultiRNNCell
A list of MultiRNNCells containing one entry if the RNN is unidirectional, and two identical entries if the
RNN is bidirectional
"""
cells = [[self._create_rnn_cell()
for _ in range(self.num_layers)]
for _ in range(2 if self.bidirectional else 1)]
return [MultiRNNCell(x) for x in cells]
评论列表
文章目录