Skip to content

Texture Vertex.num_verts_per_mesh deep copy when num_verts_per_mesh is a list #623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pytorch3d/renderer/mesh/textures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ def clone(self):
num_verts = (
self._num_verts_per_mesh.clone()
if torch.is_tensor(self._num_verts_per_mesh)
else self._num_verts_per_mesh
else self._num_verts_per_mesh.copy()
)
tex._num_verts_per_mesh = num_verts
tex.valid = self.valid.clone()
Expand All @@ -1299,7 +1299,7 @@ def detach(self):
num_verts = (
self._num_verts_per_mesh.detach()
if torch.is_tensor(self._num_verts_per_mesh)
else self._num_verts_per_mesh
else self._num_verts_per_mesh.copy()
)
tex._num_verts_per_mesh = num_verts
tex.valid = self.valid.detach()
Expand Down Expand Up @@ -1414,7 +1414,7 @@ def join_batch(self, textures: List["TexturesVertex"]) -> "TexturesVertex":

verts_features_list = []
verts_features_list += self.verts_features_list()
num_faces_per_mesh = self._num_verts_per_mesh
num_faces_per_mesh = self._num_verts_per_mesh.copy()
for tex in textures:
verts_features_list += tex.verts_features_list()
num_faces_per_mesh += tex._num_verts_per_mesh
Expand Down