mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-03 04:12:48 +08:00
suppress errors in vision/fair/pytorch3d
Differential Revision: D25777275 fbshipit-source-id: ca30fedca118ff22a8be5e29c4c4f21628c94579
This commit is contained in:
parent
b4dea43963
commit
ac3f8dc833
@ -48,9 +48,10 @@ def list_to_padded(
|
|||||||
|
|
||||||
# replace empty 1D tensors with empty tensors with a correct number of dimensions
|
# replace empty 1D tensors with empty tensors with a correct number of dimensions
|
||||||
x = [
|
x = [
|
||||||
|
# pyre-fixme[16]: `Tensor` has no attribute `new_zeros`.
|
||||||
(y.new_zeros([0] * element_ndim) if (y.ndim == 1 and y.nelement() == 0) else y)
|
(y.new_zeros([0] * element_ndim) if (y.ndim == 1 and y.nelement() == 0) else y)
|
||||||
for y in x
|
for y in x
|
||||||
] # pyre-ignore
|
]
|
||||||
|
|
||||||
if any(y.ndim != x[0].ndim for y in x):
|
if any(y.ndim != x[0].ndim for y in x):
|
||||||
raise ValueError("All items have to have the same number of dimensions!")
|
raise ValueError("All items have to have the same number of dimensions!")
|
||||||
@ -65,6 +66,7 @@ def list_to_padded(
|
|||||||
pad_dims = pad_size
|
pad_dims = pad_size
|
||||||
|
|
||||||
N = len(x)
|
N = len(x)
|
||||||
|
# pyre-fixme[16]: `Tensor` has no attribute `new_full`.
|
||||||
x_padded = x[0].new_full((N, *pad_dims), pad_value)
|
x_padded = x[0].new_full((N, *pad_dims), pad_value)
|
||||||
for i, y in enumerate(x):
|
for i, y in enumerate(x):
|
||||||
if len(y) > 0:
|
if len(y) > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user