提交 3c67d37e authored 作者: affanv14's avatar affanv14 提交者: Mohammed Affan

change dtype values in tests

上级 9f8d0b2d
...@@ -1720,8 +1720,8 @@ class Grouped_conv_noOptim(unittest.TestCase): ...@@ -1720,8 +1720,8 @@ class Grouped_conv_noOptim(unittest.TestCase):
def test_fwd(self): def test_fwd(self):
for imshp, kshp, groups in zip(self.img_shape, self.kern_shape, self.num_groups): for imshp, kshp, groups in zip(self.img_shape, self.kern_shape, self.num_groups):
img = np.random.random(imshp).astype('float32') img = np.random.random(imshp).astype(theano.config.floatX)
kern = np.random.random(kshp).astype('float32') kern = np.random.random(kshp).astype(theano.config.floatX)
split_imgs = np.split(img, groups, axis=1) split_imgs = np.split(img, groups, axis=1)
split_kern = np.split(kern, groups, axis=0) split_kern = np.split(kern, groups, axis=0)
img_sym = theano.tensor.tensor4('img') img_sym = theano.tensor.tensor4('img')
...@@ -1757,8 +1757,8 @@ class Grouped_conv_noOptim(unittest.TestCase): ...@@ -1757,8 +1757,8 @@ class Grouped_conv_noOptim(unittest.TestCase):
def test_gradweights(self): def test_gradweights(self):
for imshp, kshp, tshp, groups in zip(self.img_shape, self.kern_shape, self.top_shape, self.num_groups): for imshp, kshp, tshp, groups in zip(self.img_shape, self.kern_shape, self.top_shape, self.num_groups):
img = np.random.random(imshp).astype('float32') img = np.random.random(imshp).astype(theano.config.floatX)
top = np.random.random(tshp).astype('float32') top = np.random.random(tshp).astype(theano.config.floatX)
split_imgs = np.split(img, groups, axis=1) split_imgs = np.split(img, groups, axis=1)
split_top = np.split(top, groups, axis=1) split_top = np.split(top, groups, axis=1)
img_sym = theano.tensor.tensor4('img') img_sym = theano.tensor.tensor4('img')
...@@ -1797,8 +1797,8 @@ class Grouped_conv_noOptim(unittest.TestCase): ...@@ -1797,8 +1797,8 @@ class Grouped_conv_noOptim(unittest.TestCase):
def test_gradinputs(self): def test_gradinputs(self):
for imshp, kshp, tshp, groups in zip(self.img_shape, self.kern_shape, self.top_shape, self.num_groups): for imshp, kshp, tshp, groups in zip(self.img_shape, self.kern_shape, self.top_shape, self.num_groups):
kern = np.random.random(kshp).astype('float32') kern = np.random.random(kshp).astype(theano.config.floatX)
top = np.random.random(tshp).astype('float32') top = np.random.random(tshp).astype(theano.config.floatX)
split_kerns = np.split(kern, groups, axis=0) split_kerns = np.split(kern, groups, axis=0)
split_top = np.split(top, groups, axis=1) split_top = np.split(top, groups, axis=1)
......
...@@ -430,8 +430,8 @@ class TestGroupCorr2d(Grouped_conv_noOptim): ...@@ -430,8 +430,8 @@ class TestGroupCorr2d(Grouped_conv_noOptim):
def test_graph(self): def test_graph(self):
# define common values first # define common values first
groups = 3 groups = 3
bottom = np.random.rand(3, 6, 5, 5).astype('float32') bottom = np.random.rand(3, 6, 5, 5).astype(theano.config.floatX)
kern = np.random.rand(9, 2, 3, 3).astype('float32') kern = np.random.rand(9, 2, 3, 3).astype(theano.config.floatX)
bottom_sym = T.tensor4('bottom') bottom_sym = T.tensor4('bottom')
kern_sym = T.tensor4('kern') kern_sym = T.tensor4('kern')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论