MCPcopy Create free account
hub / github.com/TencentARC/Pixal3D / to_tensor_list

Method to_tensor_list

pixal3d/modules/sparse/basic.py:447–456  ·  view source on GitHub ↗

Convert a SparseTensor to list of tensors.

(self)

Source from the content-addressed store, hash-verified

445 return SparseTensor(feats, coords)
446
447 def to_tensor_list(self) -> Tuple[List[torch.Tensor], List[torch.Tensor]]:
448 """
449 Convert a SparseTensor to list of tensors.
450 """
451 feats_list = []
452 coords_list = []
453 for s in self.layout:
454 feats_list.append(self.feats[s])
455 coords_list.append(self.coords[s])
456 return feats_list, coords_list
457
458 def __len__(self) -> int:
459 return len(self.layout)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected