CondLayer, different dyn_size_ext in each branch output
Suppose some logic like:
with nn.Cond(nn.train_flag()) as cond:
cond.true, out_spatial_dim = nn.resize(x, axis=in_spatial_dim, factor=0.9)
cond.false = x
y = cond.result
The output of the CondLayer has different spatial dims in each branch. In the false branch, it is the same as the input x, in the true branch it is a new spatial dim via the ResizeLayer.
This is not properly supported yet. There is some heuristical hacky code but this is partly wrong and not generic.
We never really defined this case well. What should actually happen?
First problem: How do we match the different tags? Currently we assume that the output shape is the same (but we allow different axis order). The current heuristic allows one dim to be different, and then it matches it. But it would be better if this is somehow more explicit by the user. But how?
The resulting dim tag is actually yet another dim tag. It must be another output of the tf.cond.