463b5539fb1ca42fafd4791c539a53d1fc49e9ae,tensorly/backend/mxnet_backend.py,,argmax,#Any#Any#,115

Before Change


        return numpy.max(tensor, *args, **kwargs)

def argmax(data=None, axis=None):
    return nd.argmax(data, axis).astype("int32").asscalar()

def argmin(data=None, axis=None):
    return nd.argmin(data, axis).astype("int32").asscalar()

After Change


        return numpy.max(tensor, *args, **kwargs)

def argmax(data=None, axis=None):
    res = nd.argmax(data, axis)
    if res.shape == (1,):
        return res.astype("int32").asscalar()
    else:
        return res

def argmin(data=None, axis=None):
    res = nd.argmin(data, axis)
    if res.shape == (1,):
        return res.astype("int32").asscalar()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 12

Instances


Project Name: tensorly/tensorly
Commit Name: 463b5539fb1ca42fafd4791c539a53d1fc49e9ae
Time: 2018-09-19
Author: zli@wustl.edu
File Name: tensorly/backend/mxnet_backend.py
Class Name:
Method Name: argmax


Project Name: tensorly/tensorly
Commit Name: 463b5539fb1ca42fafd4791c539a53d1fc49e9ae
Time: 2018-09-19
Author: zli@wustl.edu
File Name: tensorly/backend/mxnet_backend.py
Class Name:
Method Name: argmin


Project Name: tensorly/tensorly
Commit Name: f08b65795c016562eb9dac1daffde50cec4d448c
Time: 2018-09-14
Author: zli@wustl.edu
File Name: tensorly/backend/mxnet_backend.py
Class Name:
Method Name: argmax


Project Name: tensorly/tensorly
Commit Name: f08b65795c016562eb9dac1daffde50cec4d448c
Time: 2018-09-14
Author: zli@wustl.edu
File Name: tensorly/backend/mxnet_backend.py
Class Name:
Method Name: argmin