thanks but the change would lead to another unsolvable error:
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x1 and 3x256)

which comes from this:
 def forward(self, a):

        x = F.relu(self.linear1(a))
        x = F.relu(self.linear2(x))
        x = torch.tanh(self.linear3(x))

        return x