提交 0998c9c4 authored 作者: Frederic Bastien's avatar Frederic Bastien

fix GpuCoutiguous(add view_map member) and make its c_code cachable.

上级 3a6903c7
......@@ -1895,13 +1895,19 @@ class GpuAlloc(Op):
gpu_alloc = GpuAlloc()
class GpuContiguous(Op):
def make_node(self, input):
input = as_cuda_ndarray_variable(input)
return Apply(self, [input], [input.type()])
view_map = {0: [0]}
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
def __str__(self):
return self.__class__.__name__
def make_node(self, input):
input = as_cuda_ndarray_variable(input)
return Apply(self, [input], [input.type()])
def c_code(self, node, name, (input,), (z,), sub):
fail = sub['fail']
str = """
......@@ -1929,6 +1935,9 @@ class GpuContiguous(Op):
"""%locals()
return str
def c_code_cache_version(self):
return (1,)
gpu_contiguous = GpuContiguous()
# Those are predifined CudaNdarrayType as done in tensor.basic
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论