I am trying to construct a while loop from elementary operations Enter, Merge, Switch, NextIteration, Exit. Normally, when I build a Graph, I add the Operations one-by-one following the flow of tensors, i.e. when I create an operation I can name the tensor used as an input (coming as an output of another operation). The problem is with the loop, where by nature there always exists an operation (the first to add regardless where I start to build the loop),  where I cannot specify the input tensor yet. Without that I cannot add the operation.
Somewhere I read about a “workaround” to use a dummy tensor and later change it to the output of the last element of the loop. The problem is that I cannot do that either, as a Graph is append only, no existing operation can be changed.
Can someone direct me to a page, where I can learn how to make a while loop (in TF 1.x, i.e. without tf.while)?