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: