A followup to #1694.
When you have dims=[static_dim, dyn_dim], it will currently disable the masking on the out_dim (out_dim = Dim(prod(d.get_dim_value_tensor() for d in dims), name="merged"), as the masking would not be correct (when doing out_dim = prod(dims)).
This can be unexpected. The expected behavior is that this throws an error, and the user actually wanted to do dims=[dyn_dim, static_dim].
So then we need to have a new flag here which would explicitly allow this.
Maybe also new behavior version?
(cc @dorian-K)