提交 a11e74d0 authored 作者: Roy Xue's avatar Roy Xue

Add _tensor_variable.cumprod/cumsum() interface in the theano/tensor/var.py files, in

the _tensor_py_operators class
上级 13194c9c
...@@ -549,6 +549,14 @@ class _tensor_py_operators: ...@@ -549,6 +549,14 @@ class _tensor_py_operators:
def zeros_like(model, dtype=None): def zeros_like(model, dtype=None):
return theano.tensor.basic.zeros_like(model, dtype=dtype) return theano.tensor.basic.zeros_like(model, dtype=dtype)
def cumsum(self,axis):
from theano.tensor.extra_ops import cumsum
return cumsum(x, axis)
def cumprod(self,axis):
from theano.tensor.extra_ops import cumprod
return cumprod(x, axis)
class TensorVariable(_tensor_py_operators, Variable): class TensorVariable(_tensor_py_operators, Variable):
"""Subclass to add the tensor operators to the basic `Variable` class.""" """Subclass to add the tensor operators to the basic `Variable` class."""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论