983a888f498131911a1296400448b004a53c1717,pytorch_lightning/accelerators/tpu.py,TPUAccelerator,all_gather,#TPUAccelerator#Any#Any#Any#,44

Before Change


        
        // todo: Add support for backward with all_gather
        if torch.distributed.is_initialized():
            return xm.all_gather(tensor, group=group, sync_grads=sync_grads)
        return tensor

After Change


        
        // todo: Add support for backward with all_gather
        if isinstance(self.training_type_plugin, TPUSpawnPlugin) and self.training_type_plugin.is_distributed:
            return xm.all_gather(tensor).view(-1, *tensor.shape)
        return tensor
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: williamFalcon/pytorch-lightning
Commit Name: 983a888f498131911a1296400448b004a53c1717
Time: 2021-03-19
Author: ewah1g13@soton.ac.uk
File Name: pytorch_lightning/accelerators/tpu.py
Class Name: TPUAccelerator
Method Name: all_gather


Project Name: asappresearch/sru
Commit Name: 7a2e6d4670854d4fab67088066e01664bfd61c11
Time: 2019-10-22
Author: taolei@csail.mit.edu
File Name: sru/cuda_functional.py
Class Name: SRU_Compute_GPU
Method Name: backward


Project Name: asappresearch/sru
Commit Name: 154aeb3bdfeed272ec11f9d4581f4650d94f31eb
Time: 2019-08-24
Author: taolei@csail.mit.edu
File Name: sru/cuda_functional.py
Class Name: SRU_Compute_GPU
Method Name: backward