Skip to content

Instantly share code, notes, and snippets.

@goldsborough
Created September 29, 2018 22:41
Show Gist options
  • Save goldsborough/265a13be401578611d56a9cd4cdf12f6 to your computer and use it in GitHub Desktop.
Save goldsborough/265a13be401578611d56a9cd4cdf12f6 to your computer and use it in GitHub Desktop.
- Old-style factory functions that accept a type as first argument and size as second argument have been removed. New-style factory functions accepting the size as first argument and [`TensorOptions`](https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/core/TensorOptions.h#L14) as last argument should be used instead. For example, replace your call e.g. to `at::ones(torch::CPU(at::kFloat)), {2, 3})` with `torch::ones({2, 3}, at::kCPU)`. This applies to the following functions:
- `arange`
- `empty`
- `eye`
- `full`
- `linspace`
- `logspace`
- `ones`
- `rand`
- `randint`
- `randn`
- `randperm`
- `range`
- `zeros`
We have [improved online documentation](https://pytorch.org/cppdocs) of our C++ APIs. Authors of C++ extensions may want to consult this documentation when writing new extensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment