y = np.random.randint(0, num_classes, size=(samples,)) X = np.zeros((samples,) + input_shape)foriinrange(samples): X[i] = np.random.normal(loc=y[i], scale=0.7, size=input_shape)else: y_loc = np.random.random((samples,)) X = np.zeros((samples,) + input_shape) y = n...
示例2 deftest_forward(self):batch=16len1,len2=21,24seq_len1=torch.randint(low=len1-10,high=len1+1,size=(batch,)).long()seq_len2=torch.randint(low=len2-10,high=len2+1,size=(batch,)).long()mask1=[]forwinseq_len1:mask1.append([1]*w.item()+[0]*(len1-w.item()))mask1...