Skip to content

Commit 9bbe3f2

Browse files
committed
rec_cum_concat
#31
1 parent 07d3b69 commit 9bbe3f2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nn/array_.py

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from typing import Optional, Tuple, List
66
from returnn.util.basic import NotSpecified
7+
from .. import nn
78
from .base import LayerRef, Layer
89

910

@@ -21,6 +22,18 @@ def concat(*sources: LayerRef,
2122
raise NotImplementedError(f"Cannot handle concat with axis {axis!r} yet")
2223

2324

25+
def rec_cum_concat(
26+
source: LayerRef, *, state: nn.LayerState,
27+
new_dim: nn.DimensionTag,
28+
name: Optional[str] = None) -> Tuple[Layer, nn.LayerState]:
29+
"""
30+
Concatenates all previous frames of a time-axis.
31+
See RETURNN :class:`CumConcatLayer` for details.
32+
"""
33+
from ._generated_layers import _cum_concat
34+
return _cum_concat(source=source, state=state, new_dim=new_dim, name=name)
35+
36+
2437
def split(source: LayerRef, *,
2538
axis: Optional[str] = NotSpecified,
2639
num_splits: Optional[int] = NotSpecified,

0 commit comments

Comments
 (0)