0e5431a632e9db25711931c36792bf2b620a198c,theano/gpuarray/tests/test_opt.py,,test_many_arg_elemwise,#,452

Before Change


                outputs = []
                for mode in [mode_with_gpu, mode_without_gpu]:
                    // test the optimization local_gpua_elemwise
                    f = theano.function(
                        symb_args, op_to_test(*symb_args))
                    outputs.append(f(*args))

                    // assert that the test was done on the gpu.
                    if mode is mode_with_gpu:

After Change


    // extremely large numbers of arguments on gpu.

    rng = np.random.RandomState([1, 2, 3])
    nb_of_inputs_overflows = []
    for num_args in [64]:
        for op_to_test in [theano.tensor.add, theano.tensor.mul]:
            for nb_dim in [2, 8]:
                shapes = [rng.randint(1, int(32 / nb_dim)) for i in range(nb_dim)]
                args = [np.cast["float32"](rng.randn(*shapes))
                        for arg in range(0, num_args)]

                symb_args = [theano.tensor.TensorType("float32",
                                                      (False,) * nb_dim)()
                             for arg in range(0, num_args)]

                outputs = []
                for mode in [mode_with_gpu, mode_without_gpu]:
                    // test the optimization local_gpua_elemwise
                    output = op_to_test(*symb_args)
                    f = theano.function(symb_args, output)
                    outputs.append(f(*args))

                    // assert that the test was done on the gpu.
                    if mode is mode_with_gpu:
                        nb_of_inputs_overflows.append(
                            max_inputs_to_GpuElemwise(output.owner) - num_args)
                        nodelst = [node for node in f.maker.fgraph.apply_nodes]
                        assert any(isinstance(node.op, GpuElemwise)
                                   for node in nodelst)
                        assert not any(isinstance(node.op, Elemwise)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Theano/Theano
Commit Name: 0e5431a632e9db25711931c36792bf2b620a198c
Time: 2017-04-20
Author: ahmedfar@leto21.iro.umontreal.ca
File Name: theano/gpuarray/tests/test_opt.py
Class Name:
Method Name: test_many_arg_elemwise


Project Name: daniel-kukiela/nmt-chatbot
Commit Name: c33624e189dec3ecedd83cacec50b7bd622cfb7c
Time: 2018-02-26
Author: daniel@kukiela.pl
File Name: core/scorer.py
Class Name:
Method Name: score_answers


Project Name: geomstats/geomstats
Commit Name: f0815a6bbb3af21866202175779e7acbb4b1bb1d
Time: 2021-03-24
Author: nicolas.guigui@inria.fr
File Name: geomstats/geometry/symmetric_matrices.py
Class Name: SymmetricMatrices
Method Name: apply_func_to_eigvals