Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63529
Output() takes an IntArrayRef, so we can just use a std::initializer_list (stack-allocated array) instead of std::vector here.
ghstack-source-id:
137085908
Test Plan: existing CI
Reviewed By: mruberry
Differential Revision:
D29687400
fbshipit-source-id:
9f2a7c6679f2552c098bb1bf7befaca18e0e5d4d
// We can override default options(Context::GetDeviceType())
// by explicitly passing in device type we want
Tensor* split = Output(
- 1, std::vector<int64_t>(1, InputSize()), at::dtype<int>().device(CPU));
+ 1, at::IntArrayRef({InputSize()}), at::dtype<int>().device(CPU));
int* axis_data = split->template mutable_data<int>();
auto& input_zero = Input(0);
int adj_size = input_zero.dim() + (add_axis_ ? 1 : 0);