MCPcopy Index your code
hub / github.com/microsoft/TRELLIS / sparse_unbind

Function sparse_unbind

trellis/modules/sparse/basic.py:447–459  ·  view source on GitHub ↗

Unbind a sparse tensor along a dimension. Args: input (SparseTensor): Sparse tensor to unbind. dim (int): Dimension to unbind.

(input: SparseTensor, dim: int)

Source from the content-addressed store, hash-verified

445
446
447def sparse_unbind(input: SparseTensor, dim: int) -> List[SparseTensor]:
448 """
449 Unbind a sparse tensor along a dimension.
450
451 Args:
452 input (SparseTensor): Sparse tensor to unbind.
453 dim (int): Dimension to unbind.
454 """
455 if dim == 0:
456 return [input[i] for i in range(input.shape[0])]
457 else:
458 feats = input.feats.unbind(dim)
459 return [input.replace(f) for f in feats]

Callers 1

unbindMethod · 0.85

Calls 2

unbindMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected