Commit Graph

4 Commits

Author SHA1 Message Date
Sam Gross
406c9f9c28
Remove two uses of the old Tensor class (#5413) 2018-02-26 15:00:51 -05:00
Will Feng
4d4b7782cd Fixes for Windows build on master (#4432) 2018-01-02 12:58:37 +01:00
Richard Zou
d859c3c7cc Fix creating tensors with np.longlong array 2017-12-28 09:15:03 +09:00
Sam Gross
d0cabbde74
Implement Variable.from_numpy (#4043)
Implements from_numpy using ATen tensors. Variable.from_numpy is a
convenient placeholder for the variant that returns Variables until we
merge Tensor and Variable.

The behavior is slightly changed:

 - from_numpy() on an empty array now returns an empty tensor instead of
   throwing an exception. The shape may not be preserved.
 - CharTensor(ndarray) used to throw an exception. It now copies the
   ndarray. Copying is implemented via ATen toType.
2017-12-06 14:08:56 -05:00