执行下列程序段后,得到的结果是 。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)
A: (3, 2, 2, 2)
B: (3, 2, 4, 4)
C: (3, 4, 4, 2)
D: (3, 4, 4)
举一反三
- 如下代码的输出结果是( )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:]))
- 请阅读下面一段程序: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]]]
- 执行下列程序段后,得到的结果是。importtensorflowastfimportnumpyasnpa=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=a@cprint(d.shape) A: (3,2,2,2) B: (3,2,4,4) C: (3,4,4,2) D: (3,4,4)
- 下面代码的输出结果是( )。 s=[4,3,6,2] t=sorted(s) print(s) print(t) A: [4, 3, 6, 2] [2, 3, 4, 6] B: [2, 3, 4, 6] [2, 3, 4, 6] C: [4, 3, 6, 2] [4, 3, 6, 2] D: [2, 3, 4, 6] [4, 3, 6, 2]