索引
1.basic indexing
2.numpy的索引形式
a[1,2]=a[1][2]
切片
1.base
2.[:]
a[0]=a[0,:,:,:]
3.步长
start:end :step
::step
4.倒序
::-1
5…
中间省略的维度用三个点号(…)代替
6.gather
tf.gather(params,indices,axis=0 )
从params的axis维根据indices的参数值获取切片
a=tf.constant([4,35,8])
7.gather_nd
允许在多维上进行索引
58:取三个样本,每个样本有三个维度,将第二层【】作为一个整体
59:[[scalar,scalar,scalar]]
shape=1*3 一行三列