changeset 68:315eb36ff954

fixed typo in crossentropy_dx.c_code
author bergstra@is23.m
date Fri, 18 Apr 2008 03:49:17 -0400
parents 810a8e3c85e1
children 8c2607f387e6
files nnet_ops.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
             }