Skip to content

marching_cubes does not work for cuda tensors #1679

Closed
@nikhilmishra000

Description

@nikhilmishra000

🐛 Bugs / Unexpected behaviors

pytorch3d.ops.marching_cubes.marching_cubes() does not work on v0.7.5 for cuda tensors. It throws RuntimeError: expected scalar type Int but found Long.

Instructions To Reproduce the Issue:

I am using torch==2.1.0+cu121 and I installed pytorch3d via:

pip install "git+https://github.com/facebookresearch/pytorch3d.git@v0.7.5"

The following snippet raises the error:

import torch
from pytorch3d.ops.marching_cubes import marching_cubes

x_cpu = torch.rand(4, 32, 32, 32, device="cpu")
_ = marching_cubes(x_cpu, 0.7)     # works

x_cuda = x_cpu.cuda()
_ = marching_cubes(x_cuda, 0.7)    # fails

This raises RuntimeError: expected scalar type Int but found Long.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions