@ -7,7 +7,7 @@ class TestDropoutOp(OpTest):
def setUp ( self ) :
def setUp ( self ) :
self . op_type = " dropout "
self . op_type = " dropout "
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 ) ) . astype ( " float32 " ) }
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 ) ) . astype ( " float32 " ) }
self . attrs = { ' dropout_prob ' : 0.0 , ' is_t raining' : Tru e}
self . attrs = { ' dropout_prob ' : 0.0 , ' is_t est' : Fals e}
self . outputs = {
self . outputs = {
' Out ' : self . inputs [ ' X ' ] ,
' Out ' : self . inputs [ ' X ' ] ,
' Mask ' : np . ones ( ( 32 , 64 ) ) . astype ( ' float32 ' )
' Mask ' : np . ones ( ( 32 , 64 ) ) . astype ( ' float32 ' )
@ -24,7 +24,7 @@ class TestDropoutOp2(TestDropoutOp):
def setUp ( self ) :
def setUp ( self ) :
self . op_type = " dropout "
self . op_type = " dropout "
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 ) ) . astype ( " float32 " ) }
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 ) ) . astype ( " float32 " ) }
self . attrs = { ' dropout_prob ' : 1.0 , ' is_t raining' : Tru e}
self . attrs = { ' dropout_prob ' : 1.0 , ' is_t est' : Fals e}
self . outputs = {
self . outputs = {
' Out ' : np . zeros ( ( 32 , 64 ) ) . astype ( ' float32 ' ) ,
' Out ' : np . zeros ( ( 32 , 64 ) ) . astype ( ' float32 ' ) ,
' Mask ' : np . zeros ( ( 32 , 64 ) ) . astype ( ' float32 ' )
' Mask ' : np . zeros ( ( 32 , 64 ) ) . astype ( ' float32 ' )
@ -35,7 +35,7 @@ class TestDropoutOp3(TestDropoutOp):
def setUp ( self ) :
def setUp ( self ) :
self . op_type = " dropout "
self . op_type = " dropout "
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 , 2 ) ) . astype ( " float32 " ) }
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 , 2 ) ) . astype ( " float32 " ) }
self . attrs = { ' dropout_prob ' : 0.0 , ' is_t raining' : Tru e}
self . attrs = { ' dropout_prob ' : 0.0 , ' is_t est' : Fals e}
self . outputs = {
self . outputs = {
' Out ' : self . inputs [ ' X ' ] ,
' Out ' : self . inputs [ ' X ' ] ,
' Mask ' : np . ones ( ( 32 , 64 , 2 ) ) . astype ( ' float32 ' )
' Mask ' : np . ones ( ( 32 , 64 , 2 ) ) . astype ( ' float32 ' )
@ -46,7 +46,7 @@ class TestDropoutOp4(OpTest):
def setUp ( self ) :
def setUp ( self ) :
self . op_type = " dropout "
self . op_type = " dropout "
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 ) ) . astype ( " float32 " ) }
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 ) ) . astype ( " float32 " ) }
self . attrs = { ' dropout_prob ' : 0.35 , ' is_t raining' : Fals e}
self . attrs = { ' dropout_prob ' : 0.35 , ' is_t est' : Tru e}
self . outputs = { ' Out ' : self . inputs [ ' X ' ] * self . attrs [ ' dropout_prob ' ] }
self . outputs = { ' Out ' : self . inputs [ ' X ' ] * self . attrs [ ' dropout_prob ' ] }
def test_check_output ( self ) :
def test_check_output ( self ) :
@ -57,7 +57,7 @@ class TestDropoutOp5(OpTest):
def setUp ( self ) :
def setUp ( self ) :
self . op_type = " dropout "
self . op_type = " dropout "
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 , 3 ) ) . astype ( " float32 " ) }
self . inputs = { ' X ' : np . random . random ( ( 32 , 64 , 3 ) ) . astype ( " float32 " ) }
self . attrs = { ' dropout_prob ' : 0.75 , ' is_t raining' : Fals e}
self . attrs = { ' dropout_prob ' : 0.75 , ' is_t est' : Tru e}
self . outputs = { ' Out ' : self . inputs [ ' X ' ] * self . attrs [ ' dropout_prob ' ] }
self . outputs = { ' Out ' : self . inputs [ ' X ' ] * self . attrs [ ' dropout_prob ' ] }
def test_check_output ( self ) :
def test_check_output ( self ) :