MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / interleave

Method interleave

models/freematch_entropy/freematch.py:414–420  ·  view source on GitHub ↗
(self, xy, batch)

Source from the content-addressed store, hash-verified

412 return offsets
413
414 def interleave(self, xy, batch):
415 nu = len(xy) - 1
416 offsets = self.interleave_offsets(batch, nu)
417 xy = [[v[offsets[p]:offsets[p + 1]] for p in range(nu + 1)] for v in xy]
418 for i in range(1, nu + 1):
419 xy[0][i], xy[i][i] = xy[i][i], xy[0][i]
420 return [torch.cat(v, dim=0) for v in xy]
421
422
423if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

interleave_offsetsMethod · 0.95

Tested by

no test coverage detected