I have two instances obj1 and obj2 of a pytorch nn.Module like this one
class Embedding(nn.Module):
def __init__(self, dropout=0, emb_dim):
self.lin = nn.Linear(1, emb_dim)
init.xavier_uniform(self.lin1.weight, gain=np.sqrt(2.0))
def forward(self, values)
return F.relu(self.lin1(values))
And I have two tensors of data t1, t2
I would like to do
obj1.forward(t1)
obj2.forward(t2)
in parallel in the GPU, and intuitively this would have to be possible to do, since I am executing the same operations but with different data. Is there any way I can use pytorch so I can do this?