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

Method interleave

models/uda/uda.py:308–314  ·  view source on GitHub ↗
(self, xy, batch)

Source from the content-addressed store, hash-verified

306 return offsets
307
308 def interleave(self, xy, batch):
309 nu = len(xy) - 1
310 offsets = self.interleave_offsets(batch, nu)
311 xy = [[v[offsets[p]:offsets[p + 1]] for p in range(nu + 1)] for v in xy]
312 for i in range(1, nu + 1):
313 xy[0][i], xy[i][i] = xy[i][i], xy[0][i]
314 return [torch.cat(v, dim=0) for v in xy]
315
316
317if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

interleave_offsetsMethod · 0.95

Tested by

no test coverage detected