#NEWLINE# def c_code( self , node , name , inp , out , sub ) : #NEWLINE# #INDENT# vars = dict ( out = out [ 0 ] , A = inp [ 0 ] , alpha = inp [ 1 ] , x = inp [ 2 ] , y = inp [ 3 ] , fail = sub [ 'fail' ] , name = name ) #NEWLINE# if self . inplace : #NEWLINE# #INDENT# code = ( '\n                   if (!GpuArray_ISONESEGMENT(&%(A)s->ga)) {\n                     %(out)s = theano_try_copy(%(out)s, %(A)s);\n                     if (%(out)s == NULL) {\n                       %(fail)s\n                     }\n                   } else {\n                     Py_XDECREF(%(out)s);\n                     %(out)s = %(A)s;\n                     Py_INCREF(%(out)s);\n                   }\n                   ' % vars ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# code = ( '\n                   %(out)s = theano_try_copy(%(out)s, %(A)s);\n                   if (%(out)s == NULL) {\n                       %(fail)s\n                   }\n                   ' % vars ) #NEWLINE# #UNINDENT# code += ( '\n        if (pygpu_blas_rger(((dtype_%(alpha)s *)PyArray_DATA(%(alpha)s))[0],\n                            %(x)s, %(y)s, %(out)s, 0) == -1) {\n            %(fail)s\n        }\n        ' % vars ) #NEWLINE# if config . gpuarray . sync : #NEWLINE# #INDENT# code += ( '\n            GpuArray_sync(&%(out)s->ga);\n            ' % vars ) #NEWLINE# #UNINDENT# return code