Solved by ByrdOfAFeather in post #5 
              
              
                Here is what I believe to be the best way to do it: 
import torch
import torch.nn as nn
from torch import _VF as F


class RNN(nn.Module):
	def __init__(self, input_size, hidden_size):
		super(RNN, self).__init__()
		self.hidden_size = hidden_size
		self.hh_w = torch.rand([hidden_size, hidden_size])…