Skip to content

Commit 7c67487

Browse files
authored
Rec subnet accum output layer, better dim tag (#680)
1 parent 8c0a9a8 commit 7c67487

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

returnn/tf/layers/rec.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,9 +3241,15 @@ def get_loop_acc_layer(name):
32413241
search_choices_cache=search_choices_cache)
32423242
# Use the output Data from the in-loop layer,
32433243
# as this might have set dyn sizes on dim tags.
3244+
time_dim_tag = DimensionTag.get_tag_from_size_tensor(resolved_seq_len)
3245+
if not time_dim_tag:
3246+
time_dim_tag = DimensionTag(
3247+
kind=DimensionTag.Types.Spatial,
3248+
description="dyn-time:%s/%s" % (self.parent_rec_layer.get_full_ctx_name(), name))
32443249
output = (
32453250
in_loop_layer.output
3246-
.copy_template_adding_time_dim(time_dim_axis=0)
3251+
.copy_template()
3252+
.copy_add_dim_by_tag(time_dim_tag, unbroadcast=True, axis=0)
32473253
.copy_template_set_ctx(self.parent_net.get_control_flow_ctx()))
32483254
if latest_layer_choice_name:
32493255
output.beam = self.net.layers[latest_layer_choice_name].search_choices.get_beam_info()

0 commit comments

Comments
 (0)