def make_node(self, x, index, gz):
x = as_sparse_variable(x)
gz = as_sparse_variable(gz)
assert x.format in ["csr", "csc"]
assert gz.format in ["csr", "csc"]
ind = tensor.as_tensor_variable(index)
assert ind.ndim == 1
assert "int" in ind.dtype
scipy_ver = [int(n) for n in scipy.__version__.split('.')[:2]]
if not scipy_ver >= [0, 13]:
raise NotImplementedError("Scipy version is to old")
return gof.Apply(self, [x, ind, gz], [x.type()])
评论列表
文章目录