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

Method interleave

models/freematch/freematch.py:411–417  ·  view source on GitHub ↗
(self, xy, batch)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

interleave_offsetsMethod · 0.95

Tested by

no test coverage detected