Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = tf.norm(X, ord=2, axis=0) # n.get_shape() is (?, ?, 3), not (?)
- n = tf.norm(X, ord=2, axis=[1,2,3]) # ValueError
- import tensorflow as tf
- import numpy as np
- c = tf.constant(np.random.rand(3, 2, 3, 6))
- d = tf.norm(c, ord=2)
- with tf.Session() as sess:
- print sess.run(d)
- import tensorflow as tf
- import numpy as np
- batch = tf.constant(np.random.rand(3, 2, 3, 6))
- x = tf.norm(batch, axis=3)
- x = tf.norm(x, axis=2)
- x = tf.norm(x, axis=1)
- with tf.Session() as sess:
- result = sess.run(x)
- print(result)
Add Comment
Please, Sign In to add comment