pytorch/docs/cpp/source
Will Feng 11172c19be codemod at::ArrayRef and torch::IntArrayRef to std::vector in C++ API tests (#27884)
Summary:
`at::ArrayRef` / `torch::IntArrayRef` should be discouraged in user code, because users might not be aware of the fact that it doesn't own the underlying data, which already leads to memory access bugs when they try to write the following:
```cpp
auto expected_sizes = torch::IntArrayRef({2, 16, 6});  // The memory that represents `{2, 16, 6}` is released after this line
ASSERT_EQ(output.sizes(), expected_sizes);  // `expected_sizes` is pointing to invalid memory region
```
This PR changes all usage of `at::ArrayRef` and `torch::IntArrayRef` to the corresponding `std::vector` version, so that users won't pick up the habit of using `ArrayRef` by looking at the test code.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27884

Differential Revision: D17921646

Pulled By: yf225

fbshipit-source-id: 461e79fc22b598aac230d36cc028085ce6cbe937
2019-10-14 18:00:30 -07:00
..
notes codemod at::ArrayRef and torch::IntArrayRef to std::vector in C++ API tests (#27884) 2019-10-14 18:00:30 -07:00
check-doxygen.sh Re-organize C++ API torch::nn folder structure (#26262) 2019-09-17 10:07:29 -07:00
conf.py Enable EXE001 flake8 check. (#27560) 2019-10-09 09:15:29 -07:00
contributing.rst fix sigma in the middle of when word (#16227) 2019-01-23 08:35:32 -08:00
Doxyfile Remove Tensor.h, TensorMethods.h from src/core. (#27086) 2019-10-06 09:37:50 -07:00
frontend.rst Fix C++ Frontend example in frontend.html (#15717) 2019-01-07 11:39:47 -08:00
index.rst Minor readability fixes to C++ documentation (#27338) 2019-10-03 21:45:35 -07:00
installing.rst Add copy logic for LibTorch to avoid issues on Windows (#25556) 2019-09-03 06:33:38 -07:00