4747import pytest
4848import torch
4949
50- from torch_backend_parity import (assert_cpu_accelerator_parity ,
51- move_to_device )
50+ from torch_backend_parity import (assert_cpu_accelerator_parity , move_to_device )
5251
5352if 'PATH_TO_OPEN3D_ML' in os .environ .keys ():
5453 base = os .environ ['PATH_TO_OPEN3D_ML' ]
9291
9392def _bev_box3d ():
9493 """BEVBox3D lives in Open3D-ML (ml3d), not in open3d.ml.datasets."""
95- ml_root = (os .environ .get ('OPEN3D_ML_ROOT' )
96- or os .environ .get ('PATH_TO_OPEN3D_ML' ) or base )
94+ ml_root = (os .environ .get ('OPEN3D_ML_ROOT' ) or
95+ os .environ .get ('PATH_TO_OPEN3D_ML' ) or base )
9796 if ml_root not in sys .path :
9897 sys .path .insert (0 , ml_root )
9998 from ml3d .datasets .utils import BEVBox3D
@@ -115,8 +114,7 @@ def _pointrcnn_ctor_kwargs(mode):
115114 npoints = [256 , 64 , 16 , 4 ],
116115 radius = [[0.1 , 0.5 ], [0.5 , 1.0 ], [1.0 , 2.0 ], [2.0 , 4.0 ]],
117116 nsample = [[4 , 8 ], [4 , 8 ], [4 , 8 ], [4 , 8 ]],
118- mlps = [[[8 , 8 , 16 ], [16 , 16 , 32 ]],
119- [[32 , 32 , 64 ], [32 , 48 , 64 ]],
117+ mlps = [[[8 , 8 , 16 ], [16 , 16 , 32 ]], [[32 , 32 , 64 ], [32 , 48 , 64 ]],
120118 [[64 , 98 , 128 ], [64 , 98 , 128 ]],
121119 [[128 , 128 , 256 ], [128 , 192 , 256 ]]],
122120 ),
@@ -500,8 +498,8 @@ def make_net(device=torch.device('cpu')):
500498 def run (device ):
501499 model = make_net (device )
502500 model .load_state_dict (state )
503- batcher = ml3d .dataloaders .ConcatBatcher (
504- str ( device ), model = 'PointTransformer' )
501+ batcher = ml3d .dataloaders .ConcatBatcher (str ( device ),
502+ model = 'PointTransformer' )
505503 batch = batcher .collate_fn ([sample ])
506504 batch ['data' ].to (device )
507505 out = model (batch ['data' ])
0 commit comments