mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-02-09 07:52:17 +08:00
type() deprecated
Summary: Replace `tensor.type().is_cuda()` with the preferred `tensor.is_cuda()`. Replace `AT_DISPATCH_FLOATING_TYPES(tensor.type(), ...` with `AT_DISPATCH_FLOATING_TYPES(tensor.scalar_type(), ...`. These avoid deprecation warnings in future pytorch. Reviewed By: nikhilaravi Differential Revision: D20646565 fbshipit-source-id: 1a0c15978c871af816b1dd7d4a7ea78242abd95e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e22d431e5b
commit
81a4aa18ad
@@ -63,8 +63,8 @@ std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> RasterizePointsNaive(
|
||||
const int image_size,
|
||||
const float radius,
|
||||
const int points_per_pixel) {
|
||||
if (points.type().is_cuda() && cloud_to_packed_first_idx.type().is_cuda() &&
|
||||
num_points_per_cloud.type().is_cuda()) {
|
||||
if (points.is_cuda() && cloud_to_packed_first_idx.is_cuda() &&
|
||||
num_points_per_cloud.is_cuda()) {
|
||||
#ifdef WITH_CUDA
|
||||
return RasterizePointsNaiveCuda(
|
||||
points,
|
||||
@@ -137,8 +137,8 @@ torch::Tensor RasterizePointsCoarse(
|
||||
const float radius,
|
||||
const int bin_size,
|
||||
const int max_points_per_bin) {
|
||||
if (points.type().is_cuda() && cloud_to_packed_first_idx.type().is_cuda() &&
|
||||
num_points_per_cloud.type().is_cuda()) {
|
||||
if (points.is_cuda() && cloud_to_packed_first_idx.is_cuda() &&
|
||||
num_points_per_cloud.is_cuda()) {
|
||||
#ifdef WITH_CUDA
|
||||
return RasterizePointsCoarseCuda(
|
||||
points,
|
||||
@@ -206,7 +206,7 @@ std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> RasterizePointsFine(
|
||||
const float radius,
|
||||
const int bin_size,
|
||||
const int points_per_pixel) {
|
||||
if (points.type().is_cuda()) {
|
||||
if (points.is_cuda()) {
|
||||
#ifdef WITH_CUDA
|
||||
return RasterizePointsFineCuda(
|
||||
points, bin_points, image_size, radius, bin_size, points_per_pixel);
|
||||
@@ -255,7 +255,7 @@ torch::Tensor RasterizePointsBackward(
|
||||
const torch::Tensor& idxs,
|
||||
const torch::Tensor& grad_zbuf,
|
||||
const torch::Tensor& grad_dists) {
|
||||
if (points.type().is_cuda()) {
|
||||
if (points.is_cuda()) {
|
||||
#ifdef WITH_CUDA
|
||||
return RasterizePointsBackwardCuda(points, idxs, grad_zbuf, grad_dists);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user