Skip to content

Instantly share code, notes, and snippets.

@goldsborough
Created September 29, 2018 22:41
Show Gist options
  • Select an option

  • Save goldsborough/265a13be401578611d56a9cd4cdf12f6 to your computer and use it in GitHub Desktop.

Select an option

Save goldsborough/265a13be401578611d56a9cd4cdf12f6 to your computer and use it in GitHub Desktop.

Revisions

  1. goldsborough created this gist Sep 29, 2018.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    - 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.