import tensorflow as tfimport numpy as np a = np.zeros((4,2))b = tf.random.categorical(a, 1)x = by = tf.one_hot(x, depth=2)print(tf.shape(y))
Standard input is empty
Tensor("Shape:0", shape=(3,), dtype=int32)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!