Is this not just a pathfinding problem? Discretize your world into tiles, slap on A*, where the cost function depends on distances to buildings/turrets/anything unwanted by your enemies.
could you show an implementation in python with tensorflow?
I cannot show you A* pathfinding with Tensorflow because that’s got nothing to do with it. Look it up.
oh ok