Thanks Tom, for your suggestion. updated as
		S=torch.randn((out_dim,out_dim),requires_grad=True)
		self.S = nn.Parameter(S,requires_grad=True)

		b=torch.randn(1,requires_grad=True)
		self.b = nn.Parameter(b,requires_grad=True)

It is working but performance is very slow on Tesla K80 (colab) not even faster than running of quadcore CPU(mac pro), any reason you can think of?