title: is there any difference between matmul and usual multiplication of tensors
body: <p>I am confused between the multiplication between two tensors using * and matmul.
  Below is my code</p>
  
  <pre><code>import torch
  torch.manual_seed(7)
  features = torch.randn((2, 5))
  weights = torch.randn_like(features)
  </code></pre>
  
  <p>here, i want to multiply weights and features. so, one way to do it is as follows</p>
  
  <pre><code>print(torch.sum(features * weights))
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>tensor(-2.6123)
  </code></pre>
  
  <p>Another way to do is using matmul</p>
  
  <pre><code>print(torch.mm(features,weights.view((5,2))))
  </code></pre>
  
  <p>but, here output is </p>
  
  <pre><code>tensor([[ 2.8089,  4.6439],
          [-2.3988, -1.9238]])
  </code></pre>
  
  <p>What i don't understand here is that why <code>matmul</code> and usual multiplication are giving different outputs, when both are same. Am i doing anything wrong here?</p>
  
  <p>Edit: When, i am using feature of shape <code>(1,5)</code> both * and <code>matmul</code> outputs are same. 
  but, its not the same when the shape is <code>(2,5)</code>.</p>