Skip to content

Commit

Permalink
c10::optional -> std::optional in some places
Browse files Browse the repository at this point in the history
Reviewed By: kit1980, kiran1228

Differential Revision: D67462406

fbshipit-source-id: 6371719adba0c5a7690530b997874a2ce1e045fa
  • Loading branch information
r-barnes authored and facebook-github-bot committed Dec 19, 2024
1 parent 6e2d503 commit 4e833ae
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/mipmap_grid_sampler/mipmap_grid_sampler_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ class MipmapGridSample2DFunction : public torch::autograd::Function<MipmapGridSa
bool force_max_ansio,
bool clip_grad,
const torch::Tensor& input0,
const c10::optional<torch::Tensor>& input1,
const c10::optional<torch::Tensor>& input2,
const c10::optional<torch::Tensor>& input3,
const c10::optional<torch::Tensor>& input4,
const c10::optional<torch::Tensor>& input5,
const c10::optional<torch::Tensor>& input6,
const c10::optional<torch::Tensor>& input7,
const c10::optional<torch::Tensor>& input8,
const c10::optional<torch::Tensor>& input9,
const c10::optional<torch::Tensor>& input10) {
const std::optional<torch::Tensor>& input1,
const std::optional<torch::Tensor>& input2,
const std::optional<torch::Tensor>& input3,
const std::optional<torch::Tensor>& input4,
const std::optional<torch::Tensor>& input5,
const std::optional<torch::Tensor>& input6,
const std::optional<torch::Tensor>& input7,
const std::optional<torch::Tensor>& input8,
const std::optional<torch::Tensor>& input9,
const std::optional<torch::Tensor>& input10) {
std::vector<torch::Tensor> input = {input0};
if (input1.has_value())
input.push_back(input1.value());
Expand Down Expand Up @@ -207,16 +207,16 @@ torch::Tensor mipmap_grid_sampler_2d_autograd(
force_max_ansio,
clip_grad,
input[0],
input.size() > 1 ? input[1] : c10::optional<torch::Tensor>(),
input.size() > 2 ? input[2] : c10::optional<torch::Tensor>(),
input.size() > 3 ? input[3] : c10::optional<torch::Tensor>(),
input.size() > 4 ? input[4] : c10::optional<torch::Tensor>(),
input.size() > 5 ? input[5] : c10::optional<torch::Tensor>(),
input.size() > 6 ? input[6] : c10::optional<torch::Tensor>(),
input.size() > 7 ? input[7] : c10::optional<torch::Tensor>(),
input.size() > 8 ? input[8] : c10::optional<torch::Tensor>(),
input.size() > 9 ? input[9] : c10::optional<torch::Tensor>(),
input.size() > 10 ? input[10] : c10::optional<torch::Tensor>())[0];
input.size() > 1 ? input[1] : std::optional<torch::Tensor>(),
input.size() > 2 ? input[2] : std::optional<torch::Tensor>(),
input.size() > 3 ? input[3] : std::optional<torch::Tensor>(),
input.size() > 4 ? input[4] : std::optional<torch::Tensor>(),
input.size() > 5 ? input[5] : std::optional<torch::Tensor>(),
input.size() > 6 ? input[6] : std::optional<torch::Tensor>(),
input.size() > 7 ? input[7] : std::optional<torch::Tensor>(),
input.size() > 8 ? input[8] : std::optional<torch::Tensor>(),
input.size() > 9 ? input[9] : std::optional<torch::Tensor>(),
input.size() > 10 ? input[10] : std::optional<torch::Tensor>())[0];
}

torch::Tensor mipmap_grid_sampler_2d_autocast(
Expand Down

0 comments on commit 4e833ae

Please sign in to comment.