2ce426d956944b357964d05aac99c924a00c5998,python/dgl/utils/checks.py,,prepare_tensor,#Any#Any#Any#,8

Before Change


        ret = data
    else:
        data = F.tensor(data)
        if F.dtype(data) not in (F.int32, F.int64):
            raise DGLError("Expect argument "{}" to have data type int32 or int64,"
                           " but got {}.".format(name, F.dtype(data)))
        ret = F.copy_to(F.astype(data, g.idtype), g.device)

After Change


        ret = data
    else:
        data = F.tensor(data)
        if (not (F.ndim(data) > 0 and F.shape(data)[0] == 0) and        // empty tensor
                F.dtype(data) not in (F.int32, F.int64)):
            raise DGLError("Expect argument "{}" to have data type int32 or int64,"
                           " but got {}.".format(name, F.dtype(data)))
        ret = F.copy_to(F.astype(data, g.idtype), g.device)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: dmlc/dgl
Commit Name: 2ce426d956944b357964d05aac99c924a00c5998
Time: 2020-08-24
Author: coin2028@hotmail.com
File Name: python/dgl/utils/checks.py
Class Name:
Method Name: prepare_tensor


Project Name: chris-chris/pysc2-examples
Commit Name: d941e0b2431325a7b6fba902f3ec8120687c7b20
Time: 2017-10-29
Author: sjhshy@gmail.com
File Name: acktr/acktr_disc.py
Class Name: Runner
Method Name: valid_base_action


Project Name: pyinstaller/pyinstaller
Commit Name: a578c1cf661049c0b33cf0aef5b08592d65b7047
Time: 2015-08-10
Author: mzibr.public@gmail.com
File Name: tests/functional/scripts/pyi_module_attributes.py
Class Name:
Method Name: compare


Project Name: cmu-db/ottertune
Commit Name: d09489e8b6c01bb332dac35880c606c1914bb88c
Time: 2020-04-09
Author: dongshen@andrew.cmu.edu
File Name: server/website/website/db/oracle/target_objective.py
Class Name: CustomDBTime
Method Name: compute


Project Name: cmu-db/ottertune
Commit Name: d09489e8b6c01bb332dac35880c606c1914bb88c
Time: 2020-04-09
Author: dongshen@andrew.cmu.edu
File Name: server/website/website/db/oracle/target_objective.py
Class Name: NormalizedDBTime
Method Name: compute