c177962572640832bcf14581db2a172f0ac7d700,geomstats/_backend/pytorch/__init__.py,,any,#Any#Any#,126

Before Change


def any(x, axis=None):
    if axis is None and torch.is_tensor(x):
        return x.bool().any()
    numpy_result = _np.array(_np.any(_np.array(x), axis=axis))
    return torch.from_numpy(numpy_result)


def cast(x, dtype):
    if torch.is_tensor(x):

After Change




def any(x, axis=None):
    if not torch.is_tensor(x):
        x = torch.tensor(x)
    if axis is None:
        return x.bool().any()
    return torch.any(x.bool(), axis=axis)
    //numpy_result = _np.array(_np.any(_np.array(x), axis=axis))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: geomstats/geomstats
Commit Name: c177962572640832bcf14581db2a172f0ac7d700
Time: 2020-04-23
Author: ninamio78@gmail.com
File Name: geomstats/_backend/pytorch/__init__.py
Class Name:
Method Name: any


Project Name: kengz/SLM-Lab
Commit Name: 861657d2c9b321961994c8cdd0e58b6c4fe0645f
Time: 2018-09-03
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/policy_util.py
Class Name:
Method Name: random


Project Name: geomstats/geomstats
Commit Name: 9d6281d3b2f472e5e130dbf88078c433d0795f46
Time: 2020-04-24
Author: ninamio78@gmail.com
File Name: geomstats/_backend/pytorch/__init__.py
Class Name:
Method Name: all