Thank you for the response. earlier, i had implemented the code after removing softmax(). But the resulting outputs were still same for all data values.
validset data   : tensor([[0.4765, 0.6959, 0.0277, 0.4108]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.6540, 0.9209, 0.4184, 0.8473]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.1009, 0.3274, 0.9295, 0.5534]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.3595, 0.9765, 0.8850, 0.2885]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.6617, 0.3173, 0.8160, 0.5156]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.8830, 0.8857, 0.8681, 0.1318]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.9223, 0.7067, 0.8740, 0.3126]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)


validset data   : tensor([[0.1338, 0.2998, 0.2755, 0.2248]])
validset output         : tensor([[-0.0545, -0.0238,  0.0783]], grad_fn=<AddmmBackward>)