From e13848265d9d57927fca99d13061e8fba8d468d0 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 25 Oct 2024 06:37:57 -0700 Subject: [PATCH] `at::optional` -> `std::optional` (#1170) Summary: Pull Request resolved: https://github.com/pytorch/ao/pull/1170 Reviewed By: gineshidalgo99 Differential Revision: D64938040 fbshipit-source-id: 57f98b90676ad0164a6975ea50e4414fd85ae6c4 --- pytorch3d/csrc/pulsar/pytorch/renderer.cpp | 34 +++++++++++----------- pytorch3d/csrc/pulsar/pytorch/renderer.h | 18 ++++++------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pytorch3d/csrc/pulsar/pytorch/renderer.cpp b/pytorch3d/csrc/pulsar/pytorch/renderer.cpp index aa53192c..018ca1ad 100644 --- a/pytorch3d/csrc/pulsar/pytorch/renderer.cpp +++ b/pytorch3d/csrc/pulsar/pytorch/renderer.cpp @@ -888,14 +888,14 @@ std::tuple Renderer::forward( }; std::tuple< - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional> + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional> Renderer::backward( const torch::Tensor& grad_im, const torch::Tensor& image, @@ -922,7 +922,7 @@ Renderer::backward( const bool& dif_rad, const bool& dif_cam, const bool& dif_opy, - const at::optional>& dbg_pos) { + const std::optional>& dbg_pos) { this->ensure_on_device(this->device_tracker.device()); size_t batch_size; size_t n_points; @@ -1045,14 +1045,14 @@ Renderer::backward( } // Prepare the return value. std::tuple< - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional> + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional> ret; if (mode == 1 || (!dif_pos && !dif_col && !dif_rad && !dif_cam && !dif_opy)) { return ret; diff --git a/pytorch3d/csrc/pulsar/pytorch/renderer.h b/pytorch3d/csrc/pulsar/pytorch/renderer.h index 33f9e24f..90bc3c82 100644 --- a/pytorch3d/csrc/pulsar/pytorch/renderer.h +++ b/pytorch3d/csrc/pulsar/pytorch/renderer.h @@ -51,14 +51,14 @@ struct Renderer { const uint& mode); std::tuple< - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional, - at::optional> + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional, + std::optional> backward( const torch::Tensor& grad_im, const torch::Tensor& image, @@ -85,7 +85,7 @@ struct Renderer { const bool& dif_rad, const bool& dif_cam, const bool& dif_opy, - const at::optional>& dbg_pos); + const std::optional>& dbg_pos); // Infrastructure. /**