#NEWLINE# def infer_shape( self , node , i_shapes ) : #NEWLINE# #INDENT# rval = [ ] #NEWLINE# for o in node . outputs : #NEWLINE# #INDENT# oshp = [ ] #NEWLINE# for ( dim , b ) in enumerate ( o . type . broadcastable ) : #NEWLINE# #INDENT# b_dim = None #NEWLINE# if b : #NEWLINE# #INDENT# b_dim = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for ( ishp , i ) in izip ( i_shapes , node . inputs ) : #NEWLINE# #INDENT# if isinstance ( i . type , theano . scalar . Scalar ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not i . type . broadcastable [ dim ] ) : #NEWLINE# #INDENT# if ishp [ dim ] : #NEWLINE# #INDENT# b_dim = ishp [ dim ] #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# oshp . append ( b_dim ) #NEWLINE# #UNINDENT# rval . append ( tuple ( oshp ) ) #NEWLINE# #UNINDENT# return rval