in models/base_ssl3d_model.py [0:0]
def _single_input_forward(self, batch, feature_names, input_key, target):
if "vox" not in input_key:
assert isinstance(batch, torch.Tensor)
if ('vox' in input_key) and ("Lidar" not in self.config):
points = batch
points_coords = points[0]
points_feats = points[1]
### Invariant to even and odd coords
points_coords[:, 1:] += (torch.rand(3) * 100).type_as(points_coords)
points_feats = points_feats/255.0 - 0.5
batch = SparseTensor(points_feats, points_coords.float())
if ('vox' in input_key) and ("Lidar" in self.config):
# Copy to GPU
for key in batch:
batch[key] = main_utils.recursive_copy_to_gpu(
batch[key], non_blocking=True
)
else:
# Copy to GPU
batch = main_utils.recursive_copy_to_gpu(
batch, non_blocking=True
)
feats = self.trunk[target](batch, feature_names)
return feats