class_docstr: This op can be inplace if behaviour is 'times1_inplace'
  This op can be destructive if behaviour is 'times2_inplace'
  
  In both cases, it does not set the destroy_map or view_map correctly so
  it should raise an error in DebugMode.
class_docstr_tok: ["This","op","can","be","inplace","if","behaviour","is","'times1_inplace'","This","op","can","be","destructive","if","behaviour","is","'times2_inplace'","In","both","cases",",","it","does","not","set","the","destroy_map","or","view_map","correctly","so","it","should","raise","an","error","in","DebugMode","."]
code: def c_code(self, node, name, inp, out, sub):
      (a,) = inp
      (z,) = out
      if "inplace" in self.behaviour:
          z_code = """
              {Py_XDECREF(%(z)s);}
              Py_INCREF(%(a)s);
              %(z)s = %(a)s;
              """
      else:
          z_code = """
              {Py_XDECREF(%(z)s);}
              %(z)s = (PyArrayObject*) PyArray_SimpleNew(1, PyArray_DIMS(%(a)s), PyArray_DESCR(%(a)s)->type_num);
              """
      prep_vars = """
              //the output array has size M x N
              npy_intp M = PyArray_DIMS(%(a)s)[0];
              npy_intp Sa = PyArray_STRIDES(%(a)s)[0] / PyArray_DESCR(%(a)s)->elsize;
              npy_intp Sz = PyArray_STRIDES(%(z)s)[0] / PyArray_DESCR(%(z)s)->elsize;
  
              npy_double * Da = (npy_double*)PyArray_BYTES(%(a)s);
              npy_double * Dz = (npy_double*)PyArray_BYTES(%(z)s);
  
              //clear the output array
              for (npy_intp m = 0; m < M; ++m)
              {
          """
  
      if self.behaviour == "times2":
          behaviour = "     Dz[m * Sz] = 2 * Da[m * Sa]; "
          # out[0] = a * 2
      elif self.behaviour == "times2_inplace":
          # out[0] = a
          # out[0] *= 2
          behaviour = "     Dz[m * Sz] = 2 * Da[m * Sa]; "
      elif self.behaviour == "times1":
          # out[0] = a * 1
          behaviour = "     Dz[m * Sz] = Da[m * Sa]; "
      elif self.behaviour == "times1_inplace":
          # out[0] = a
          behaviour = ""
      else:
          raise ValueError(self.behaviour)
  
      prep_vars2 = """
              }
          """
  
      total = (z_code + prep_vars + behaviour + prep_vars2) % dict(
          locals(), **sub
      )
      return total
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  import unittest
  from nose.plugins.skip import SkipTest
  import numpy
  from six import reraise
  from theano import config
  from theano import gof
  import theano
  from theano.compat import exc_message
  from theano.compile import debugmode
  import theano.tensor
  from theano.tests import unittest_tools
label_desc: Use image node_id 5 for calling the WeirdBrokenOp obj's underlying member method code with example usage: obj.c_code(node, name, inp, out, sub) and returns: total