Skip to content

Commit

Permalink
TF GatherLayer cleanup
Browse files Browse the repository at this point in the history
size_placeholder logic is deprecated
and obsolete due to dim tags.
  • Loading branch information
albertz committed Sep 4, 2023
1 parent d467538 commit a9eebce
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions returnn/tf/layers/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,25 +1781,6 @@ def get_out_data_from_opts(cls, name, sources, position, axis, **kwargs):
out_type["dim"] = NotSpecified

output_data = Data(**out_type)

# Take size_placeholder from input_data if they exist there, otherwise from position_data
size_placeholder = {}
for input_axis, size in input_data.size_placeholder.items():
input_axis = input_data.get_batch_axis(input_axis)
if input_axis == old_gather_axis:
continue
output_axis = output_data.get_batch_axis_excluding_batch(
cls._translate_input_axis(input_axis, old_gather_axis, common_axes_input, input_axes, position_axes)
)
size_placeholder[output_axis] = size
for position_axis, size in position_data.size_placeholder.items():
position_axis = position_data.get_batch_axis(position_axis)
output_axis = output_data.get_batch_axis_excluding_batch(
cls._translate_position_axis(position_axis, old_gather_axis, common_axes_position, position_axes)
)
size_placeholder.setdefault(output_axis, size)
output_data.size_placeholder = size_placeholder

return output_data

@classmethod
Expand Down

0 comments on commit a9eebce

Please sign in to comment.