#NEWLINE# def test_get_capture_size( self ) : #NEWLINE# #INDENT# gs = simple_board ( ) #NEWLINE# pp = Preprocess ( [ 'capture_size' ] ) #NEWLINE# feature = pp . state_to_tensor ( gs ) [ 0 ] . transpose ( ( 1 , 2 , 0 ) ) #NEWLINE# one_hot_capture = np . zeros ( ( gs . size , gs . size , 8 ) ) #NEWLINE# for ( x , y ) in gs . get_legal_moves ( ) : #NEWLINE# #INDENT# one_hot_capture [ ( x , y , 0 ) ] = 1 #NEWLINE# #UNINDENT# for i in range ( 8 ) : #NEWLINE# #INDENT# self . assertTrue ( np . all ( ( feature [ : , : , i ] == one_hot_capture [ : , : , i ] ) ) , ( 'bad expectation: capturing %d stones' % i ) )