code_3.py 222 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4
x0_train = np.ones((len(X_train), 1)) # 构造X长度的全1数组配合对偏置的点积
X_train = np.append(x0_train, X_train, axis=1) #把X增加一系列的1
print ("张量X的形状:", X_train.shape)
print (X_train)