

def grad(self, inputs, gout):
    (x, y) = inputs
    (gz,) = gout
    assert _is_sparse_variable(gz)
    assert _is_sparse_variable(x)
    rval = [true_dot(gz, y.T), true_dot(x.T, gz)]
    if _is_dense_variable(y):
        if self.grad_preserves_dense:
            rval[1] = dense_from_sparse(rval[1])
    return rval

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py TrueDot.grad/original