From 4e833ae7fb67c0b1c835d1f2789464c7e4c19fbf Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Thu, 19 Dec 2024 10:33:38 -0800 Subject: [PATCH] c10::optional -> std::optional in some places Reviewed By: kit1980, kiran1228 Differential Revision: D67462406 fbshipit-source-id: 6371719adba0c5a7690530b997874a2ce1e045fa --- .../mipmap_grid_sampler_module.cpp | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/mipmap_grid_sampler/mipmap_grid_sampler_module.cpp b/src/mipmap_grid_sampler/mipmap_grid_sampler_module.cpp index bcb4e67..df56d9b 100644 --- a/src/mipmap_grid_sampler/mipmap_grid_sampler_module.cpp +++ b/src/mipmap_grid_sampler/mipmap_grid_sampler_module.cpp @@ -54,16 +54,16 @@ class MipmapGridSample2DFunction : public torch::autograd::Function& input1, - const c10::optional& input2, - const c10::optional& input3, - const c10::optional& input4, - const c10::optional& input5, - const c10::optional& input6, - const c10::optional& input7, - const c10::optional& input8, - const c10::optional& input9, - const c10::optional& input10) { + const std::optional& input1, + const std::optional& input2, + const std::optional& input3, + const std::optional& input4, + const std::optional& input5, + const std::optional& input6, + const std::optional& input7, + const std::optional& input8, + const std::optional& input9, + const std::optional& input10) { std::vector input = {input0}; if (input1.has_value()) input.push_back(input1.value()); @@ -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(), - input.size() > 2 ? input[2] : c10::optional(), - input.size() > 3 ? input[3] : c10::optional(), - input.size() > 4 ? input[4] : c10::optional(), - input.size() > 5 ? input[5] : c10::optional(), - input.size() > 6 ? input[6] : c10::optional(), - input.size() > 7 ? input[7] : c10::optional(), - input.size() > 8 ? input[8] : c10::optional(), - input.size() > 9 ? input[9] : c10::optional(), - input.size() > 10 ? input[10] : c10::optional())[0]; + input.size() > 1 ? input[1] : std::optional(), + input.size() > 2 ? input[2] : std::optional(), + input.size() > 3 ? input[3] : std::optional(), + input.size() > 4 ? input[4] : std::optional(), + input.size() > 5 ? input[5] : std::optional(), + input.size() > 6 ? input[6] : std::optional(), + input.size() > 7 ? input[7] : std::optional(), + input.size() > 8 ? input[8] : std::optional(), + input.size() > 9 ? input[9] : std::optional(), + input.size() > 10 ? input[10] : std::optional())[0]; } torch::Tensor mipmap_grid_sampler_2d_autocast(