I tried to implement this structure, but I‘am not sure that’s right. The following code just a example.
class TestDNN(nn.Module):
    def __init__(self):
        super(TestDNN, self).__init__()
        self.speaker_code = nn.Parameter(torch.randn(1))
        self.fc1 = nn.Linear(2, 2, bias=False)      
        self.fc2 = nn.Linear(3, 1, bias=False)
    
    def forward(self, input):
        x = torch.cat((self.speaker_code.repeat(input.shape[0],1), input), 1)                  
        x = self.fc1(x)
        x = torch.cat((self.speaker_code.repeat(input.shape[0],1), x),1)                                
        return self.fc2(x)