@@ -103,6 +103,8 @@ def forward(
103
103
104
104
embeds = create_embeddings_for_implicit_function (
105
105
xyz_world = rays_points_world ,
106
+ # pyre-fixme[6]: For 2nd argument expected `Optional[(...) -> Any]` but
107
+ # got `Union[Tensor, Module]`.
106
108
xyz_embedding_function = self ._harmonic_embedding ,
107
109
global_code = global_code ,
108
110
fun_viewpool = fun_viewpool ,
@@ -112,6 +114,7 @@ def forward(
112
114
113
115
# Before running the network, we have to resize embeds to ndims=3,
114
116
# otherwise the SRN layers consume huge amounts of memory.
117
+ # pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
115
118
raymarch_features = self ._net (
116
119
embeds .view (embeds .shape [0 ], - 1 , embeds .shape [- 1 ])
117
120
)
@@ -166,7 +169,9 @@ def _get_colors(self, features: torch.Tensor, rays_directions: torch.Tensor):
166
169
# Normalize the ray_directions to unit l2 norm.
167
170
rays_directions_normed = torch .nn .functional .normalize (rays_directions , dim = - 1 )
168
171
# Obtain the harmonic embedding of the normalized ray directions.
172
+ # pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
169
173
rays_embedding = self ._harmonic_embedding (rays_directions_normed )
174
+ # pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
170
175
return self ._color_layer ((features , rays_embedding ))
171
176
172
177
def forward (
@@ -195,20 +200,24 @@ def forward(
195
200
denoting the color of each ray point.
196
201
"""
197
202
# raymarch_features.shape = [minibatch x ... x pts_per_ray x 3]
203
+ # pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
198
204
features = self ._net (raymarch_features )
199
205
# features.shape = [minibatch x ... x self.n_hidden_units]
200
206
201
207
if self .ray_dir_in_camera_coords :
202
208
if camera is None :
203
209
raise ValueError ("Camera must be given if xyz_ray_dir_in_camera_coords" )
204
210
211
+ # pyre-fixme[58]: `@` is not supported for operand types `Tensor` and
212
+ # `Union[Tensor, Module]`.
205
213
directions = ray_bundle .directions @ camera .R
206
214
else :
207
215
directions = ray_bundle .directions
208
216
209
217
# NNs operate on the flattenned rays; reshaping to the correct spatial size
210
218
features = features .reshape (* raymarch_features .shape [:- 1 ], - 1 )
211
219
220
+ # pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
212
221
raw_densities = self ._density_layer (features )
213
222
214
223
rays_colors = self ._get_colors (features , directions )
@@ -269,6 +278,7 @@ def _run_hypernet(self, global_code: torch.Tensor) -> Tuple[SRNRaymarchFunction]
269
278
srn_raymarch_function.
270
279
"""
271
280
281
+ # pyre-fixme[29]: `Union[Tensor, Module]` is not a function.
272
282
net = self ._hypernet (global_code )
273
283
274
284
# use the hyper-net generated network to instantiate the raymarch module
@@ -304,6 +314,8 @@ def forward(
304
314
# across LSTM iterations for the same global_code.
305
315
if self .cached_srn_raymarch_function is None :
306
316
# generate the raymarching network from the hypernet
317
+ # pyre-fixme[16]: `SRNRaymarchHyperNet` has no attribute
318
+ # `cached_srn_raymarch_function`.
307
319
self .cached_srn_raymarch_function = self ._run_hypernet (global_code )
308
320
(srn_raymarch_function ,) = cast (
309
321
Tuple [SRNRaymarchFunction ], self .cached_srn_raymarch_function
@@ -331,6 +343,7 @@ def __post_init__(self):
331
343
def create_raymarch_function (self ) -> None :
332
344
self .raymarch_function = SRNRaymarchFunction (
333
345
latent_dim = self .latent_dim ,
346
+ # pyre-fixme[32]: Keyword argument must be a mapping with string keys.
334
347
** self .raymarch_function_args ,
335
348
)
336
349
@@ -389,6 +402,7 @@ def create_hypernet(self) -> None:
389
402
self .hypernet = SRNRaymarchHyperNet (
390
403
latent_dim = self .latent_dim ,
391
404
latent_dim_hypernet = self .latent_dim_hypernet ,
405
+ # pyre-fixme[32]: Keyword argument must be a mapping with string keys.
392
406
** self .hypernet_args ,
393
407
)
394
408
0 commit comments