mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary:
Another simple bit of syntax that NumPy supports and we don't.
Support int, float, and bool.
```python
>>> torch.randn((2,3), dtype=float)
tensor([[-0.1752, -0.3240, -0.6148],
[ 0.1861, 1.6472, 0.1687]], dtype=torch.float64)
```
A bit confusingly, Python's "float" actually means double, but nothing we can do about that.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21215
Differential Revision: D15697012
Pulled By: umanwizard
fbshipit-source-id: 9a38d960a610b8e67023486b0c9265edd3c22246
|
||
|---|---|---|
| .. | ||
| auto_gil.h | ||
| cuda_enabled.h | ||
| cuda_lazy_init.cpp | ||
| cuda_lazy_init.h | ||
| disallow_copy.h | ||
| hash.h | ||
| invalid_arguments.cpp | ||
| invalid_arguments.h | ||
| memory.h | ||
| numpy_stub.h | ||
| object_ptr.cpp | ||
| object_ptr.h | ||
| pybind.h | ||
| python_arg_parser.cpp | ||
| python_arg_parser.h | ||
| python_compat.h | ||
| python_numbers.h | ||
| python_scalars.h | ||
| python_strings.h | ||
| python_stub.h | ||
| python_tuples.h | ||
| six.h | ||
| structseq.cpp | ||
| structseq.h | ||
| tensor_apply.cpp | ||
| tensor_apply.h | ||
| tensor_dtypes.cpp | ||
| tensor_dtypes.h | ||
| tensor_flatten.cpp | ||
| tensor_flatten.h | ||
| tensor_layouts.cpp | ||
| tensor_layouts.h | ||
| tensor_list.cpp | ||
| tensor_list.h | ||
| tensor_memoryformats.cpp | ||
| tensor_memoryformats.h | ||
| tensor_new.cpp | ||
| tensor_new.h | ||
| tensor_numpy.cpp | ||
| tensor_numpy.h | ||
| tensor_types.cpp | ||
| tensor_types.h | ||
| tuple_parser.cpp | ||
| tuple_parser.h | ||
| variadic.cpp | ||
| variadic.h | ||