title: Efficiently add numbers to the end of each dimension of a tensor
body: <p>I have a tensor x of shape (n, 200). I want to make it shape (n, 218), by appending a tensor of 18 numbers to the end of every &quot;row&quot; of the current tensor. n varies based on the batch size, so I want a way to do this for any n.<br />
  As of right now, I have a working solution, but I was wondering if there is a built-in way to do this, I did not see anything in the documentation particularly.
  My method is:</p>
  <pre class="lang-py prettyprint-override"><code>import torch.nn.functional as F
  x = F.pad(input = x, (0, 18, 0, 0)) # pad each tensor in dim 2 with 18 zeroes
  for index in range(x.shape[0]): 
      x[index][-18] = nums_to_add # nums_to_add is a tensor with size (1,18)
  </code></pre>
  <p>This works just fine, but I was wondering if there is any easier way to do this, without first padding the zeroes.</p>