<s> import unittest <EOL> import numpy <EOL> import chainer <EOL> from chainer import cuda <EOL> from chainer import functions <EOL> from chainer import testing <EOL> from chainer . testing import attr <EOL> class TestDropout ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . x = numpy . random . uniform ( - <NUM_LIT:1> , <NUM_LIT:1> , ( <NUM_LIT:2> , <NUM_LIT:3> ) ) . astype ( numpy . float32 ) <EOL> self . gy = numpy . random . uniform ( - <NUM_LIT:1> , <NUM_LIT:1> , ( <NUM_LIT:2> , <NUM_LIT:3> ) ) . astype ( numpy . float32 ) <EOL> def check_type_forward ( self , x_data ) : <EOL> x = chainer . Variable ( x_data ) <EOL> functions . dropout ( x ) <EOL> def test_type_forward_cpu ( self ) : <EOL> self . check_type_forward ( self . x ) <EOL> @ attr . gpu <EOL> def test_type_forward_gpu ( self ) : <EOL> self . check_type_forward ( cuda . to_gpu ( self . x ) ) <EOL> testing . run_module ( __name__ , __file__ ) </s>
