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

Method interleave

models/fullysupervised/fullysupervised.py:253–259  ·  view source on GitHub ↗
(self, xy, batch)

Source from the content-addressed store, hash-verified

251 return offsets
252
253 def interleave(self, xy, batch):
254 nu = len(xy) - 1
255 offsets = self.interleave_offsets(batch, nu)
256 xy = [[v[offsets[p]:offsets[p + 1]] for p in range(nu + 1)] for v in xy]
257 for i in range(1, nu + 1):
258 xy[0][i], xy[i][i] = xy[i][i], xy[0][i]
259 return [torch.cat(v, dim=0) for v in xy]
260
261
262if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

interleave_offsetsMethod · 0.95

Tested by

no test coverage detected