Indeed things changed in 12.2 w.r.t the order of NetGraph's port.
The rule is the following: the ports are in the order in which they appear in the list of edges.
Note that some ports, like NetPort["Input"] (or NetPort["Output"]), can be implicit. In this case, we treat them as if they appeared in the list the first time they should appear.
So for example, in 12.2:
In[1]:= Information[NetGraph[{1,2,3}, {1->2, NetPort["B"]->3}], "InputPorts"]
Out[1]= <|Input->Automatic, B->Automatic|>
In[2]:= Information[NetGraph[{1,2,3}, {NetPort["B"]->3, 1->2}], "InputPorts"]
Out[2]= <|B->Automatic, Input->Automatic|>
whereas both these two commands used to return <|Input->Automatic,B->Automatic|>
in 12.1 and before (where the port order only depended on the NetGraph topology, and was independent of how the user ordered the layers and the edges).
In your example, you should rather change how the NetGraph "dec_1"
, "dec_2"
, ... are defined (so the definition of dec2
), so that the ports "Input1"
and "Input2"
are ordered as you want.
I believe the same code can work both for 12.1 and 12.2