Currently, the tensor flow cannot be collected along axes other than the first - he requested .
But for what you want to do in this particular situation, you can transpose and then collect 0.2.4 and then transfer it back. It will not be insanely fast, but it works:
tf.transpose(tf.gather(tf.transpose(y), [0,2,4]))
This is a useful solution for some limitations in the current collection implementation.
(But itβs also true that you cannot use numpy slice in the tensor stream node - you can run it and cut the output, as well as that you need to initialize these variables before starting. :). You mix tf and np so that it doesn't work.
x = tf.Something(...)
- object of the tensor flow graph. Numpy does not know how to handle such objects.
foo = tf.run(x)
returns to an object that python can handle.
Usually you want to keep the loss calculation in a pure tensor flow, so that cross and other functions in tf. You will probably have to do arccos a long way, since tf has no function for it.
source share