CARVIEW |
Select Language
HTTP/2 200
date: Mon, 28 Jul 2025 04:50:28 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/facebookresearch/pytorch3d.git
etag: W/"d82589412f9054c8a32f54fb46ee09a0"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=sMhb8GmTXQoDeNeAMpXQmvK2QmzzdaRSMwfZUaHd%2FTYuUWjydp%2BqG05Qy5PW%2Fawt6alaewWvGZ6X7LqPLDwYu4kwkTrN%2BFtbDD1jBQnODEXBgnR9TCEMt%2Beqlz56e0Yiz2c4nG5CSHHYWWKSbJcCaVzp%2Bp%2BMaZXZODy2K4kXC6PLfjzbt%2BbzmNYsmxiIDLaQGiC8btg%2B1C3MSvBVL%2F4fBsZFsxeSIhK%2BzIwQ5wfdbX5%2Bhizk9lgO9GzVAymOjVYnhP7UaFf6XjCt8uMweNGX%2Bw%3D%3D--dFYw6Y%2Bjs%2B%2FBIStA--RTq4rCl7Ev2cmHuX4KTkRw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.58006388.1753678227; Path=/; Domain=github.com; Expires=Tue, 28 Jul 2026 04:50:27 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 28 Jul 2026 04:50:27 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A898:2CB2E7:13D0951:1A4177D:68870193
Support for moving the renderer to a new device · facebookresearch/pytorch3d@956d3a0 · GitHub
Copy file name to clipboardExpand all lines: pytorch3d/renderer/blending.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/mesh/rasterizer.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/mesh/renderer.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/mesh/shader.py
Copy file name to clipboardExpand all lines: tests/test_render_meshes.py
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit 956d3a0
Support for moving the renderer to a new device
Summary:
Support for moving all the tensors of the renderer to another device by calling `renderer.to(new_device)`
Currently the `MeshRenderer`, `MeshRasterizer` and `SoftPhongShader` (and other shaders) are all of type `nn.Module` which already supports easily moving tensors of submodules (defined as class attributes) to a different device. However the class attributes of the rasterizer and shader (e.g. cameras, lights, materials), are of type `TensorProperties`, not nn.Module so we need to explicity create a `to` method to move these tensors to device. Note that the `TensorProperties` class already has a `to` method so we only need to call `cameras.to(device)` and don't need to worry about the internal tensors.
The other option is of course making these other classes (cameras, lights etc) also of type nn.Module.
Reviewed By: gkioxari
Differential Revision: D23885107
fbshipit-source-id: d71565c442181f739de4d797076ed5d00fb67f8e1 parent b1eee57 commit 956d3a0Copy full SHA for 956d3a0
File tree
Expand file treeCollapse file tree
5 files changed
+107
-1
lines changedFilter options
- pytorch3d/renderer
- mesh
- tests
Expand file treeCollapse file tree
5 files changed
+107
-1
lines changedpytorch3d/renderer/blending.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/blending.py+3-1Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
| 49 | + | |
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| 166 | + | |
| 167 | + | |
166 | 168 |
| |
167 | 169 |
| |
168 | 170 |
| |
|
pytorch3d/renderer/mesh/rasterizer.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/mesh/rasterizer.py+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 |
| |
80 | 84 |
| |
81 | 85 |
| |
|
pytorch3d/renderer/mesh/renderer.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/mesh/renderer.py+6Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 |
| |
37 | 42 |
| |
38 | 43 |
| |
| |||
44 | 49 |
| |
45 | 50 |
| |
46 | 51 |
| |
| 52 | + | |
47 | 53 |
| |
48 | 54 |
| |
49 | 55 |
| |
|
pytorch3d/renderer/mesh/shader.py
Copy file name to clipboardExpand all lines: pytorch3d/renderer/mesh/shader.py+30Lines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 |
| |
54 | 60 |
| |
55 | 61 |
| |
| |||
98 | 104 |
| |
99 | 105 |
| |
100 | 106 |
| |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
101 | 113 |
| |
102 | 114 |
| |
103 | 115 |
| |
| |||
151 | 163 |
| |
152 | 164 |
| |
153 | 165 |
| |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
154 | 172 |
| |
155 | 173 |
| |
156 | 174 |
| |
| |||
203 | 221 |
| |
204 | 222 |
| |
205 | 223 |
| |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
206 | 230 |
| |
207 | 231 |
| |
208 | 232 |
| |
| |||
272 | 296 |
| |
273 | 297 |
| |
274 | 298 |
| |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
275 | 305 |
| |
276 | 306 |
| |
277 | 307 |
| |
|
tests/test_render_meshes.py
Copy file name to clipboardExpand all lines: tests/test_render_meshes.py+64Lines changed: 64 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1042 | 1042 |
| |
1043 | 1043 |
| |
1044 | 1044 |
| |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + |
You can’t perform that action at this time.
0 commit comments