# HG changeset patch # User bergstra@is23.m # Date 1208504957 14400 # Node ID 315eb36ff9542f1e3bcbe06989b279e7794c8061 # Parent 810a8e3c85e1a63e915987419a889fcc59990cec fixed typo in crossentropy_dx.c_code diff -r 810a8e3c85e1 -r 315eb36ff954 nnet_ops.py --- a/nnet_ops.py Fri Apr 18 03:35:58 2008 -0400 +++ b/nnet_ops.py Fri Apr 18 03:49:17 2008 -0400 @@ -259,8 +259,7 @@ %(fail)s; } if ((%(dnll)s->dimensions[0] != %(sm)s->dimensions[0]) - || (%(dnll)s->dimensions[0] != %(y_idx)s->dimensions[0]) - || (%(dnll)s->dimensions[0] != %(dx)s->dimensions[0])) + || (%(dnll)s->dimensions[0] != %(y_idx)s->dimensions[0])) { PyErr_SetString(PyExc_ValueError, "dimension mismatch"); %(fail)s; @@ -270,10 +269,8 @@ || (%(dx)s->dimensions[1] != %(sm)s->dimensions[1])) { if (NULL != %(dx)s) Py_XDECREF(%(dx)s); - %(dx)s = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(%(x)s), type_num_%(x)s); + %(dx)s = (PyArrayObject*)PyArray_SimpleNew(2, PyArray_DIMS(%(sm)s), type_num_%(sm)s); if(!%(dx)s) { - // The normal cleanup code will take care of %(nll)s - // Py_XDECREF(%(nll)s); %(nll)s=NULL; PyErr_SetString(PyExc_MemoryError, "failed to alloc dx output"); %(fail)s }