@staticmethod
    def _numpy_call(f_str, tensors):
        '''
        evaluate function f from f_str and tensros

        f_str: name of varialbe in the form of x0 - xn
        tensors: numpy tensor vals
        '''
        # convert to numpy str
        f_str = f_str.replace('be', 'np')
        f_str = f_str.replace('np.sig', 'CustomFunc.sig')
        f_str = f_str.replace('np.sig2', 'CustomFunc.sig2')
        f_str = f_str.replace('np.tanh2', 'CustomFunc.tanh2')
        f_str = f_str.replace('np.argmax', 'CustomFunc.argmax')
        f_str = f_str.replace('np.argmin', 'CustomFunc.argmin')
        # TODO debug only
        f_str = f_str.replace('axis=0', 'axis=0, keepdims=True')
        # TODO debug only
        f_str = f_str.replace('axis=1', 'axis=1, keepdims=True')

        # give variable name to the tensors
        count = 0
        for tensor in tensors:
            exec(count % 'x%s = tensor') in globals(), locals()
            count += 1

        # execute
        result = None
        exec('result = ' + f_str)

        return result
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/tests/test_autodiff_extra.py/TestAutodiff._numpy_call/swapped operands of `%`