MCPcopy Create free account
hub / github.com/CrossmodalGroup/LAPS / forward

Method forward

lib/utils.py:460–468  ·  view source on GitHub ↗
(ctx, tensor)

Source from the content-addressed store, hash-verified

458
459 @staticmethod
460 def forward(ctx, tensor):
461 ctx.batch_size = tensor.shape[0]
462
463 gathered_tensor = [torch.zeros_like(tensor) for _ in range(torch.distributed.get_world_size())]
464
465 torch.distributed.all_gather(gathered_tensor, tensor)
466 gathered_tensor = torch.cat(gathered_tensor, 0)
467
468 return gathered_tensor
469
470 @staticmethod
471 def backward(ctx, grad_output):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected