Custom (Vanilla) RNN Layer


I have been working to implement a simple one layer (Vainlla) RNN model using Pytorch. I am beginner in pytorch and I don’t know why my forward function is not working (my program is not calling forward method).
Would some one plz guide me or assist me to resolve this issue ? I shall be very thankful
Here is my implementation:

input_dimensions = 3
output_dimensions = 1
hidden_units = 5
x = Variable(torch.randn(1,input_dimensions))
y =  Variable(torch.randn(1,output_dimensions))
hidden_init = Variable(torch.randn(1, hidden_units))
class Net(nn.Module):
	def __init__(self):
		super(Net, self).__init__()
		self.input_dimensions = input_dimensions
		self.output_dimensions = output_dimensions
		self.Wih = nn.Parameter(torch.Tensor(input_dimensions, hidden_units))
		self.Uhh = nn. Parameter(torch.Tensor(hidden_units, hidden_units))
		self.Wy = nn.Parameter(torch.Tensor(hidden_units, output_dimensions))
		print('initialization has finished')
      def forward(self, x):
		W_ih =
		U_hh =
		updated_hidden = W_ih + U_ih
		output =
                print('output', output)
		return output
model = Net()

you haven’t actually called the model yet.

Have you tried doing:

output = model(x)

Thank you for reply but would you please let me know where should I call (output = model(x)) my model in my code ?
Thank you

please do one of the basic tutorials. you need to call the model with an input to get the output.