title: How do I multiply matrices in PyTorch?
body: <p>With numpy, I can do a simple matrix multiplication like this:</p>
  <pre><code>a = numpy.ones((3, 2))
  b = numpy.ones((2, 1))
  result = a.dot(b)
  </code></pre>
  <p>However, this does not work with PyTorch:</p>
  <pre><code>a = torch.ones((3, 2))
  b = torch.ones((2, 1))
  result = torch.dot(a, b)
  </code></pre>
  <p>This code throws the following error:</p>
  <blockquote>
  <p>RuntimeError: 1D tensors expected, but got 2D and 2D tensors</p>
  </blockquote>
  <p>How do I perform matrix multiplication in PyTorch?</p>