df38756fb9220bd605acc3e8d5fd42f7f43c3a1e,tests/test_ops.py,OpsTestCase,random,#OpsTestCase#,56

Before Change


    def random(self, *shapes):
        if all(isinstance(i, int) for i in shapes):
            shapes = [shapes]
        arrays = tuple(np.random.rand(*shape) for shape in shapes)
        return arrays[0] if len(shapes) == 1 else arrays

    def test_Identity(self):
        t = tf.identity(self.random(3, 4))

After Change



    def random(self, *shapes, **kwargs):
        if all(isinstance(i, int) for i in shapes):
            if kwargs.get("complex", False):
                return self.random(*shapes) + 1j * self.random(*shapes)
            else:
                return np.random.rand(*shapes)
        else:
            return tuple(self.random(*shape) for shape in shapes)

    def test_Identity(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: riga/tfdeploy
Commit Name: df38756fb9220bd605acc3e8d5fd42f7f43c3a1e
Time: 2016-03-10
Author: marcelrieger@me.com
File Name: tests/test_ops.py
Class Name: OpsTestCase
Method Name: random


Project Name: catalyst-team/catalyst
Commit Name: 021b07ba9751b9eb817e6b9e203612abf5a9ce18
Time: 2019-11-10
Author: alex.gaziev@gmail.com
File Name: catalyst/dl/experiment/config.py
Class Name: ConfigExperiment
Method Name: get_callbacks