提交 f1d4a78b authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add make_variable and move value_zeros.

上级 cd064270
......@@ -15,10 +15,6 @@ except ImportError:
pass
class GpuArrayType(Type):
def value_zeros(self, shape):
return pygpu.gpuarray.zeros(shape, dtype=self.typecode, kind=self.kind,
context=self.context)
def __init__(self, dtype, broadcastable, kind=None, context=None,
name=None):
import globals
......@@ -99,6 +95,13 @@ class GpuArrayType(Type):
"(1e-8 + 1e-5 * fabs(%(b)s)))")
return numpy.asarray(res).all()
def value_zeros(self, shape):
return pygpu.gpuarray.zeros(shape, dtype=self.typecode, kind=self.kind,
context=self.context)
def make_variable(self, name=None):
return self.Variable(self, name=name)
def __eq__(self, other):
return (type(self) == type(other) and
self.typecode == other.typecode and
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论