MCPcopy Create free account
hub / github.com/microsoft/TRELLIS.2 / to_dense

Method to_dense

trellis2/modules/sparse/basic.py:679–689  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

677 return new_tensor
678
679 def to_dense(self) -> torch.Tensor:
680 if config.CONV == 'torchsparse':
681 return self.data.dense()
682 elif config.CONV == 'spconv':
683 return self.data.dense()
684 else:
685 spatial_shape = self.spatial_shape
686 ret = torch.zeros(*self.shape, *spatial_shape, dtype=self.dtype, device=self.device)
687 idx = [self.coords[:, 0], slice(None)] + self.coords[:, 1:].unbind(1)
688 ret[tuple(idx)] = self.feats
689 return ret
690
691 @staticmethod
692 def full(aabb, dim, value, dtype=torch.float32, device=None) -> 'SparseTensor':

Callers

nothing calls this directly

Calls 1

unbindMethod · 0.45

Tested by

no test coverage detected