319882b5679229124774e91d5c5762853d75f3ce,test/agent/net/test_nn.py,TestNet,test_output,#TestNet#Any#,109

Before Change


        """ Checks that the output of the net is not zero or nan """
        net = test_nets[0]
        if type(net.in_dim) is int:
            dummy_input = Variable(torch.ones(2, net.in_dim))
        else:
            dummy_input = Variable(torch.ones(2, *net.in_dim))
        out = net(dummy_input)
        flag = True

After Change


        flag = True
        if net.__class__.__name__.find("MultiMLPNet") != -1:
            zero_test = sum([torch.sum(torch.abs(x.data)) for x in out])
            nan_test = np.isnan(sum([torch.sum(x.data) for x in out]))
        else:
            zero_test = torch.sum(torch.abs(out.data))
            nan_test = np.isnan(torch.sum(out.data))
        if zero_test < SMALL_NUM:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: kengz/SLM-Lab
Commit Name: 319882b5679229124774e91d5c5762853d75f3ce
Time: 2018-01-06
Author: lgraesser@users.noreply.github.com
File Name: test/agent/net/test_nn.py
Class Name: TestNet
Method Name: test_output


Project Name: pymc-devs/pymc3
Commit Name: 971db0748a9d5d07a6d6102c656b2c3b043e9231
Time: 2017-07-16
Author: ctm22396@gmail.com
File Name: pymc3/step_methods/hmc/base_hmc.py
Class Name: BaseHMC
Method Name: __init__


Project Name: pymc-devs/pymc3
Commit Name: 15737a9c0f9437de0ee25ff3fb69518ea87c1c06
Time: 2016-02-16
Author: thomas.wiecki@gmail.com
File Name: pymc3/step_methods/metropolis.py
Class Name: Metropolis
Method Name: __init__