执行下列程序段后,得到的结果是_______。importtensorflowastfimportnumpyasnpa=tf.constant(np.arange(24).reshape(4,2,3))b=tf.constant(np.arange(6).reshape(3,2))c=a@bprint(c.shape)
A: (3,2,3)
B: (4,2,3)
C: (4,2,2)
D: (3,2,2)
A: (3,2,3)
B: (4,2,3)
C: (4,2,2)
D: (3,2,2)
举一反三
- 执行下列程序段后,得到的结果是 。import tensorflow as tfimport numpy as npa = tf.constant(np.arange(48).reshape(3,2,4,2))b =tf.random.shuffle(a)c = tf.constant(np.arange(8).reshape(2,4))d =[email protected](d.sh A: (3, 2, 2, 2) B: (3, 2, 4, 4) C: (3, 4, 4, 2) D: (3, 4, 4)
- 请阅读下面一段程序:arr = np.arange(6).reshape(1, 2, 3)print(arr.transpose(2, 0, 1))执行上述程序后,最终输出的结果为( )。 A: [[[2 5]][[0 3]][[1 4]]] B: [[[1 4]] [[0 3]] [[2 5]]] C: [[[0 3]][[1 4]][[2 5]]] D: [[[0] [3]][[1] [4]][[2] [5]]]
- 如下代码的输出结果是( )import numpy as npa = np.arange(12).reshape(3, 4)print(np.sum(a[1:, 2:]))
- 如下代码的输出结果是( )import numpy as npa = np.arange(12).reshape(3, 4)print(np.sum(a[[0, 2], 2:]))
- A=[1 2 3;6 5 4]; reshape(A,3,2)= ( )