np.concatenate()函数类似于torch.cat()函数

import random
import numpy as np

random.seed(0)
a = np.random.randn(2,3)
b = np.random.randn(2,3)
c = np.concatenate((a, b), axis=0)
d = np.concatenate((a, b), axis=1)

print("a:\n-----\n", a)
print("b:\n-----\n", b)
print("c:\n-----\n", c)
print("d:\n-----\n", d)

a:
-----
 [[-0.20512506  2.09148353  0.07333005]
 [ 0.74309513 -1.97919177  0.63844411]]
b:
-----
 [[ 0.36332038 -0.77519834  1.23217508]
 [ 0.59555455 -3.04889988 -0.39933057]]
c:
-----
 [[-0.20512506  2.09148353  0.07333005]
 [ 0.74309513 -1.97919177  0.63844411]
 [ 0.36332038 -0.77519834  1.23217508]
 [ 0.59555455 -3.04889988 -0.39933057]]
d:
-----
 [[-0.20512506  2.09148353  0.07333005  0.36332038 -0.77519834  1.23217508]
 [ 0.74309513 -1.97919177  0.63844411  0.59555455 -3.04889988 -0.39933057]]

你可能感兴趣的:(目标检测,python,numpy)