#NEWLINE# def configure( self , in_obj ) : #NEWLINE# #INDENT# super ( Pooling , self ) . configure ( in_obj ) #NEWLINE# if ( self . nglayer is None ) : #NEWLINE# #INDENT# assert isinstance ( self . in_shape , tuple ) #NEWLINE# ikeys = ( ( 'C' , 'H' , 'W' ) if ( len ( self . in_shape ) == 3 ) else ( 'C' , 'D' , 'H' , 'W' ) ) #NEWLINE# shapedict = { k : x for ( k , x ) in zip ( ikeys , self . in_shape ) } #NEWLINE# shapedict [ 'N' ] = self . be . bsz #NEWLINE# self . poolparams . update ( shapedict ) #NEWLINE# if ( self . poolparams [ 'R' ] is None ) : #NEWLINE# #INDENT# self . poolparams [ 'R' ] = shapedict [ 'H' ] #NEWLINE# self . poolparams [ 'S' ] = shapedict [ 'W' ] #NEWLINE# #UNINDENT# self . nglayer = self . be . pool_layer ( self . be . default_dtype , ** self . poolparams ) #NEWLINE# ( K , M , P , Q , N ) = self . nglayer . dimO #NEWLINE# self . out_shape = ( ( K , M , P , Q ) if ( len ( self . in_shape ) == 4 ) else ( K , P , Q ) ) #NEWLINE# #UNINDENT# return self