Ich möchte eine Rotationsmatrix im Tensorflow erstellen, in der alle Teile davon Tensoren sind.So erstellen Sie eine Rotationsmatrix in Tensorflow
Was ich habe:
def rotate(tf, points, theta):
rotation_matrix = [[tf.cos(theta), -tf.sin(theta)],
[tf.sin(theta), tf.cos(theta)]]
return tf.matmul(points, rotation_matrix)
Aber das sagt, dass rotation_matrix
ist eine Liste von Tensoren anstelle eines Tensor selbst. theta
ist auch ein Tensor-Objekt, das zur Laufzeit übergeben wird.
Dies ist eine gute Lösung! –
Ich habe darüber nachgedacht, aber dann habe ich es vergessen. Ich denke, das ist eloquenter als das, was ich gerade mache. – dtracers
'tf.pack' wurde in' tf.stack' umbenannt, siehe https://github.com/tensorflow/tensorflow/issues/7550 – Hooked