Skip to content

Commit 2a0660b

Browse files
bottlerfacebook-github-bot
authored andcommitted
Flexible #channels in TexturesUV.join_scene
Summary: The TexturesUV class supports an arbitrary number of channels. In one place in join_scene we unnecessarily assumed the usual value, 3. Reviewed By: patricklabatut Differential Revision: D29133477 fbshipit-source-id: de8eb15fdd55675da084634d9d99e2a3f4d35401
1 parent c538725 commit 2a0660b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pytorch3d/renderer/mesh/textures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,8 +1121,9 @@ def join_scene(self) -> "TexturesUV":
11211121
)
11221122
)
11231123
merging_plan = pack_unique_rectangles(heights_and_widths)
1124+
C = maps[0].shape[-1]
11241125
# pyre-fixme[16]: `Tensor` has no attribute `new_zeros`.
1125-
single_map = maps[0].new_zeros((*merging_plan.total_size, 3))
1126+
single_map = maps[0].new_zeros((*merging_plan.total_size, C))
11261127
verts_uvs = self.verts_uvs_list()
11271128
verts_uvs_merged = []
11281129

0 commit comments

Comments
 (0)