torch 矩阵合并

发布于:2021-10-25 17:29:12

for i in range(1210):
if 1210%(i+1)==0:
print(i+1)


import numpy as np
a = np.array([[1, 1, 2],
[9, 4, 5],
[5, 7, 8]])

b = np.array([[3, 2, 4],
[6, 8, 6],
[3, 5, 16]])

#水*组合
c = np.hstack((a, b))
c1 = np.concatenate((a,b),axis=1)

#垂直组合
d = np.vstack((a, b))
d1 = np.concatenate((a,b),axis=0)
print(c)

lists = [0, 1, 2, 3, 4, 5]
# 输出 5, 4, 3, 2, 1, 0
for i in range(5, -1, -1):
print(lists[i])

# 输出5, 4, 3
for i in range(5, 2, -1):
print(lists[i])

相关推荐

最新更新

猜你喜欢