Solved by ptrblck in post #2 
              
              
                The number of input features for the linear layer is defined as 10, while you pass an input of [batch_size=10, features=100]. 
Also note, that torch.empty returns an uninitialized tensor, so you might have random values, Infs, NaNs, etc. in the tensor.