mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +08:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									58566963d6
								
							
						
					
					
						commit
						e13848265d
					
				@ -888,14 +888,14 @@ std::tuple<torch::Tensor, torch::Tensor> Renderer::forward(
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
std::tuple<
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>,
 | 
			
		||||
    at::optional<torch::Tensor>>
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>,
 | 
			
		||||
    std::optional<torch::Tensor>>
 | 
			
		||||
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<std::pair<uint, uint>>& dbg_pos) {
 | 
			
		||||
    const std::optional<std::pair<uint, uint>>& 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<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>>
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>>
 | 
			
		||||
      ret;
 | 
			
		||||
  if (mode == 1 || (!dif_pos && !dif_col && !dif_rad && !dif_cam && !dif_opy)) {
 | 
			
		||||
    return ret;
 | 
			
		||||
 | 
			
		||||
@ -51,14 +51,14 @@ struct Renderer {
 | 
			
		||||
      const uint& mode);
 | 
			
		||||
 | 
			
		||||
  std::tuple<
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>,
 | 
			
		||||
      at::optional<torch::Tensor>>
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>,
 | 
			
		||||
      std::optional<torch::Tensor>>
 | 
			
		||||
  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<std::pair<uint, uint>>& dbg_pos);
 | 
			
		||||
      const std::optional<std::pair<uint, uint>>& dbg_pos);
 | 
			
		||||
 | 
			
		||||
  // Infrastructure.
 | 
			
		||||
  /**
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user