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

Method interleave

models/mixmatch/mixmatch.py:310–316  ·  view source on GitHub ↗
(self, xy, batch)

Source from the content-addressed store, hash-verified

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

Callers 1

trainMethod · 0.95

Calls 1

interleave_offsetsMethod · 0.95

Tested by

no test coverage detected