#NEWLINE# def make_node( self , img , topgrad , shape = None ) : #NEWLINE# #INDENT# img = as_tensor_variable ( img ) #NEWLINE# topgrad = as_tensor_variable ( topgrad ) #NEWLINE# if ( height_width . type . ndim != 4 ) : #NEWLINE# #INDENT# raise TypeError ( 'img must be 4D tensor' ) #NEWLINE# #UNINDENT# if ( topgrad . type . ndim != 4 ) : #NEWLINE# #INDENT# raise TypeError ( 'topgrad must be 4D tensor' ) #NEWLINE# #UNINDENT# if ( ( self . subsample != ( 1 , 1 ) ) or ( self . border_mode == 'half' ) ) : #NEWLINE# #INDENT# if ( shape is None ) : #NEWLINE# #INDENT# raise ValueError ( 'shape must be given if subsample != (1, 1) or border_mode == "half"' ) #NEWLINE# #UNINDENT# height_width = [ as_tensor_variable ( shape [ 0 ] ) . astype ( 'int64' ) , as_tensor_variable ( shape [ 1 ] ) . astype ( 'int64' ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# height_width = [ ] #NEWLINE# #UNINDENT# broadcastable = [ topgrad . type . broadcastable [ 1 ] , img . type . broadcastable [ 1 ] , False , False ] #NEWLINE# dtype = img . type . dtype #NEWLINE# return Apply ( self , ( [ img , topgrad ] + height_width ) , [ TensorType ( dtype , broadcastable ) ( ) ] )