提交 e68ccc58 authored 作者: Vivek Kulkarni's avatar Vivek Kulkarni

Taken care of code review comments partially

上级 79bfd205
......@@ -8,9 +8,11 @@ http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps
# Automatic methods for determining best sparse format?
import sys
import numpy
import theano
import scipy.sparse
from theano import gof, tensor, compile, scalar, config
from theano.gof.python25 import all
from theano.gradient import DisconnectedType
......@@ -1754,8 +1756,8 @@ class AddSD(gof.op.Op):
%(z)s = (PyArrayObject *) PyArray_NewCopy(%(y)s, NPY_CORDER);
}else{
%(z)s = %(y)s;
}
Py_XINCREF(%(z)s);
}
npy_intp N = PyArray_DIMS(%(_indptr)s)[0]-1;
const npy_int32 * __restrict__ indptr = (npy_int32 *)%(_indptr)s->data;
......
......@@ -6593,11 +6593,7 @@ class ConstructSparse(Op):
def connection_pattern(self, node):
rval = [[True], [True]]
for ipt in node.inputs[2:]:
rval.append([False])
rval = [[True], [True], [False]]
return rval
def grad(self, inputs, grads):
......@@ -6700,11 +6696,7 @@ class AdvancedIncSubtensor1(Op):
def connection_pattern(self, node):
rval = [[True], [True]]
for ipt in node.inputs[2:]:
rval.append([False])
rval = [[True], [True], [False]]
return rval
def grad(self, inputs, grads):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论