Linux一次执行多条命令:使用for
for id in 111 222 ; do echo $id ; done
for ((a=1;a<=6;a++)) ; do echo $(du -sh /tmp); done
for id in {1..10} ; do echo $id; done
awk
输出奇数行
awk '{if(FNR%2!=0) print FNR$0}' 1.tx
PyTorch Tensor自带的方法view()和reshape():
view(): Returns a new tensor with the same data as the self tensor but of a different shape.
reshape(): Returns a tensor with the same data and number of elements