

def grad(self, inputs, gout):
    (x,) = inputs
    (gz,) = gout
    if self.sparse_grad:
        left = sp_ones_like(x)
        right = self
        if ((right.dtype == 'float64') and (left.dtype == 'float32')):
            left = left.astype('float64')
        if ((right.dtype == 'float32') and (left.dtype == 'float64')):
            right = right.astype('float64')
        return [(left * right)]
    else:
        return [SparseFromDense(x.type.format)(gz)]

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py DenseFromSparse.grad/VarMisuse@44/52 `gz`->`self`