MCPcopy Create free account
hub / github.com/Pointcept/SegmentAnything3D / offset2batch

Function offset2batch

libs/pointops/functions/utils.py:92–96  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

90
91
92def offset2batch(offset):
93 return torch.cat([
94 torch.tensor([i] * (o - offset[i - 1])) if i > 0 else torch.tensor([i] * o)
95 for i, o in enumerate(offset)
96 ], dim=0).long().to(offset.device)
97
98
99def batch2offset(batch):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected