title: Obtain torch.tensor from string of floats
body: <p>We can convert 1 dimensional array of floats, stored as a space separated numbers in text file, in to a numpy array or a  torch tensor as follows. </p>
  
  <pre><code>line = "1 5 3 7 4"
  np_array = np.fromstring(line, dtype='int', sep=" ")
  
  np_array
  &gt;&gt; array([1, 5, 3, 7, 4])
  </code></pre>
  
  <p>And to convert above numpy array to a torch tensor, we can do following :</p>
  
  <pre><code>torch_tensor = torch.tensor(np_array)
  torch_tensor
  &gt;&gt;tensor([1, 5, 3, 7, 4])
  </code></pre>
  
  <p>How can I convert a string of numbers separated by space in to a <code>torch.Tensor</code> directly without 
  converting them to a numpy array? We can also do this by fist splitting the string at a space, mapping them to int or float, and then feeding it to <code>torch.tensor</code>. But like <code>numpy</code>'s <code>fromstring</code>, is there any such method in pytorch?</p>