Sorry but I can’t read your code. Try format your code using
```Python


your code here

```
Every op in the forward  function need to be Variable
so it need to be
weight=Variable(t.zeros(Batch_size,Batch_size))

and maybe you shall not use for loop, try vectorize your code.