Example #1
0
 def test_cast_array(self):
     """Make sure array are cast to float and returned as array of values"""
     dim = Real('yolo', 'uniform', -3, 4)
     assert np.all(dim.cast(np.array(['1', '2'])) == np.array([1.0, 2.0]))
Example #2
0
 def test_cast_array(self):
     """Make sure array are cast to float and returned as array of values"""
     dim = Real("yolo", "uniform", -3, 4)
     assert np.all(dim.cast(np.array(["1", "2"])) == np.array([1.0, 2.0]))
Example #3
0
 def test_cast_list(self):
     """Make sure list are cast to float and returned as list of values"""
     dim = Real('yolo', 'uniform', -3, 4)
     assert dim.cast(['1', '2']) == [1.0, 2.0]
Example #4
0
 def test_cast_list(self):
     """Make sure list are cast to float and returned as list of values"""
     dim = Real("yolo", "uniform", -3, 4)
     assert dim.cast(["1", "2"]) == [1.0, 2.0]