46b03dae5a8333a38c072da8e541da6fe5c0912d,grid/services/torch/hook_worker_service.py,HookWorkerService,compile_result,#HookWorkerService#Any#Any#,68

Before Change


            result = self.register_object(result, owners=owners)
            registration = dict(id=result.id,
                owners=result.owners, is_pointer=True)
            return {"torch_type":torch_type, "registration":registration}
        except AttributeError:
            // Sometimes result is a sequence of tensors
            return [self.compile_result(x, owners) for x in result]

After Change


                return {"numeric":result}
            // result is usually a tensor/variable
            print(result)
            torch_type = re.search("<class "(torch.(.*))">",
                str(result.__class__)).group(1)

            try:
                var_data = self.compile_result(result.data, owners)
            except (AttributeError, RuntimeError):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: OpenMined/Grid
Commit Name: 46b03dae5a8333a38c072da8e541da6fe5c0912d
Time: 2018-04-10
Author: jason@manc.us
File Name: grid/services/torch/hook_worker_service.py
Class Name: HookWorkerService
Method Name: compile_result


Project Name: matplotlib/matplotlib
Commit Name: b8cd2d592460cbe8fd6977702623cc739305f7de
Time: 2018-09-06
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/artist.py
Class Name: ArtistInspector
Method Name: get_aliases


Project Name: matplotlib/matplotlib
Commit Name: 56fb1c6e2be3e8238c72efe558c34aacfcd39b52
Time: 2018-09-10
Author: jklymak@gmail.com
File Name: lib/matplotlib/artist.py
Class Name: ArtistInspector
Method Name: get_aliases


Project Name: rtavenar/tslearn
Commit Name: 58cb5e6c44bb9f3f85de74c85584e926b5954610
Time: 2019-06-28
Author: romain.tavenard@univ-rennes2.fr
File Name: setup.py
Class Name:
Method Name: