使用
# T是个整数tensor
np.concatenate((align[1:],T.cpu().numpy()), axis=0)
报错ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 0 dimension(s)
查看align[1:]及T.cpu().numpy()的shape如下:
T.cpu().numpy()少了一维。更改如下
np.concatenate((align[1:],[T.cpu().numpy()]), axis=0)
#或
np.concatenate((align[1:],T.cpu().numpy().reshape(-1)), axis=0)