@@ -1984,18 +1984,18 @@ def make_layer_dict(self,
1984
1984
1985
1985
1986
1986
# noinspection PyShadowingBuiltins,PyShadowingNames
1987
- def window (
1988
- source : LayerRef ,
1989
- * ,
1990
- state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
1991
- initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
1992
- window_size : int ,
1993
- window_left : Optional [int ] = NotSpecified ,
1994
- window_right : Optional [int ] = NotSpecified ,
1995
- axis : str = NotSpecified ,
1996
- padding : str = NotSpecified ,
1997
- stride : int = NotSpecified ,
1998
- name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
1987
+ def _window (
1988
+ source : LayerRef ,
1989
+ * ,
1990
+ state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
1991
+ initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
1992
+ window_size : int ,
1993
+ window_left : Optional [int ] = NotSpecified ,
1994
+ window_right : Optional [int ] = NotSpecified ,
1995
+ axis : str = NotSpecified ,
1996
+ padding : str = NotSpecified ,
1997
+ stride : int = NotSpecified ,
1998
+ name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
1999
1999
"""
2000
2000
Adds a window dimension.
2001
2001
By default, uses the time axis and goes over it with a sliding window.
@@ -2095,15 +2095,15 @@ def make_layer_dict(self,
2095
2095
2096
2096
2097
2097
# noinspection PyShadowingBuiltins,PyShadowingNames
2098
- def cumsum (
2099
- source : LayerRef ,
2100
- * ,
2101
- state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
2102
- initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
2103
- axis : str = NotSpecified ,
2104
- additional_left_summand_per_element : Optional [Union [str , int , float ]] = NotSpecified ,
2105
- reverse : bool = NotSpecified ,
2106
- name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
2098
+ def _cumsum (
2099
+ source : LayerRef ,
2100
+ * ,
2101
+ state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
2102
+ initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
2103
+ axis : str = NotSpecified ,
2104
+ additional_left_summand_per_element : Optional [Union [str , int , float ]] = NotSpecified ,
2105
+ reverse : bool = NotSpecified ,
2106
+ name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
2107
2107
"""
2108
2108
Basically wraps tf.cumsum. Also supports that in the RecLayer.
2109
2109
@@ -6455,19 +6455,19 @@ def make_layer_dict(self,
6455
6455
6456
6456
6457
6457
# noinspection PyShadowingBuiltins,PyShadowingNames
6458
- def ken_lm_state (
6459
- source : LayerRef ,
6460
- * ,
6461
- state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6462
- initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6463
- lm_file : Any ,
6464
- vocab_file : Optional [str ] = NotSpecified ,
6465
- vocab_unknown_label : str = NotSpecified ,
6466
- bpe_merge_symbol : Optional [str ] = NotSpecified ,
6467
- input_step_offset : int = NotSpecified ,
6468
- dense_output : bool = NotSpecified ,
6469
- debug : bool = NotSpecified ,
6470
- name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
6458
+ def _ken_lm_state (
6459
+ source : LayerRef ,
6460
+ * ,
6461
+ state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6462
+ initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6463
+ lm_file : Any ,
6464
+ vocab_file : Optional [str ] = NotSpecified ,
6465
+ vocab_unknown_label : str = NotSpecified ,
6466
+ bpe_merge_symbol : Optional [str ] = NotSpecified ,
6467
+ input_step_offset : int = NotSpecified ,
6468
+ dense_output : bool = NotSpecified ,
6469
+ debug : bool = NotSpecified ,
6470
+ name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
6471
6471
"""
6472
6472
Get next word (or subword) each frame,
6473
6473
accumulates string,
@@ -6565,14 +6565,14 @@ def make_layer_dict(self,
6565
6565
6566
6566
6567
6567
# noinspection PyShadowingBuiltins,PyShadowingNames
6568
- def edit_distance_table (
6569
- source : LayerRef ,
6570
- * ,
6571
- state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6572
- initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6573
- debug : bool = NotSpecified ,
6574
- blank_idx : Optional [int ] = NotSpecified ,
6575
- name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
6568
+ def _edit_distance_table (
6569
+ source : LayerRef ,
6570
+ * ,
6571
+ state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6572
+ initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6573
+ debug : bool = NotSpecified ,
6574
+ blank_idx : Optional [int ] = NotSpecified ,
6575
+ name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
6576
6576
"""
6577
6577
Given a source and a target, calculates the edit distance table between them.
6578
6578
Source can be inside a recurrent loop.
@@ -6730,13 +6730,13 @@ def make_layer_dict(self,
6730
6730
6731
6731
6732
6732
# noinspection PyShadowingBuiltins,PyShadowingNames
6733
- def unmask (
6734
- source : LayerRef ,
6735
- * ,
6736
- state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6737
- initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6738
- mask : LayerRef ,
6739
- name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
6733
+ def _unmask (
6734
+ source : LayerRef ,
6735
+ * ,
6736
+ state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6737
+ initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
6738
+ mask : LayerRef ,
6739
+ name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
6740
6740
"""
6741
6741
This is meant to be used together with :class:`MaskedComputationLayer`,
6742
6742
which operates on input [B,T,D], and given a mask, returns [B,T',D'].
@@ -7002,13 +7002,13 @@ def make_layer_dict(self,
7002
7002
7003
7003
7004
7004
# noinspection PyShadowingBuiltins,PyShadowingNames
7005
- def cum_concat (
7006
- source : LayerRef ,
7007
- * ,
7008
- state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
7009
- initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
7010
- new_dim : DimensionTag ,
7011
- name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
7005
+ def _cum_concat (
7006
+ source : LayerRef ,
7007
+ * ,
7008
+ state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
7009
+ initial_state : Optional [Union [LayerRef , Dict [str , LayerRef ], NotSpecified ]] = NotSpecified ,
7010
+ new_dim : DimensionTag ,
7011
+ name : Optional [Union [str , NameCtx ]] = None ) -> Tuple [Layer , Union [LayerRef , Any ]]:
7012
7012
"""
7013
7013
Concatenates all previous frames of a time-axis.
7014
7014
Like :class:`CumsumLayer` uses `sum`, this layer uses `concat`.
0 commit comments