i want to ask which one is better in the aspect of speed.




device=torch.device("cuda")
class fc_layer(nn.Module):
    def __init__(self):
        super(fc_layer,self).__init__()
        self.linear1=nn.Linear(emb_size,emb_size)
    def forward(self,x):
        y=self.linear1(x)
        a=np.ones((2,3))
        a=torch.tensor(a,dtype=torch.float32).to(device)
        y=y+a
        return y





device=torch.device("cuda")
class fc_layer(nn.Module):
    def __init__(self):
        super(fc_layer,self).__init__()
        self.linear1=nn.Linear(emb_size,emb_size)
    def forward(self,x):
        y=self.linear1(x)
        a=torch.ones(2,3).to(device)
        y=y+a
        return y





device=torch.device("cuda")
class fc_layer(nn.Module):
    def __init__(self):
        super(fc_layer,self).__init__()
        self.linear1=nn.Linear(emb_size,emb_size)
    def forward(self,x):
        y=self.linear1(x)
        a=torch.ones(2,3,device=device)
        y=y+a
        return y

by the way, is there any faster ways?