I am using Python2.7, and I can\'t update it, and I have this line of code, which raise an error at the asterisk, and I don\'t know why? And how to fix!
inp = tf.
That asterisk syntax is not available in Python 2. It was added in Python 3.5 (PEP 448) which was 7 years ago.
The Python 2 equivalent was
o = tf.gather_nd(inp, [(i,j) for (i,j) in enumerate(am)])
But you really should not be using Python 2 or investing time in learning it. You don't have to "update" your existing Python 2 installation, if you need it to run legacy code. You can have Python 3.8 running side-by-side with Python 2 if you want. For work reasons I have 3.8, 3.7, 3.6 and 2.7 side-by-side on my machine without problems.