提交 c60af257 authored 作者: Frederic's avatar Frederic

fix the __hash__ of inplace pattern in pycuda op.

上级 ea99dcb4
...@@ -28,6 +28,7 @@ from theano.sandbox.cuda import GpuElemwise, CudaNdarrayType, GpuOp ...@@ -28,6 +28,7 @@ from theano.sandbox.cuda import GpuElemwise, CudaNdarrayType, GpuOp
from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable, from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
gpu_contiguous) gpu_contiguous)
from theano.sandbox.cuda.opt import gpu_seqopt from theano.sandbox.cuda.opt import gpu_seqopt
from theano.tensor.utils import hash_from_dict
import pycuda_init import pycuda_init
if not pycuda_init.pycuda_available: if not pycuda_init.pycuda_available:
...@@ -116,7 +117,7 @@ class PycudaElemwiseKernelOp(GpuOp): ...@@ -116,7 +117,7 @@ class PycudaElemwiseKernelOp(GpuOp):
def __hash__(self): def __hash__(self):
return (hash(type(self)) ^ hash(self.scalar_op) ^ return (hash(type(self)) ^ hash(self.scalar_op) ^
hash(self.inplace_pattern)) hash_from_dict(self.inplace_pattern))
def make_node(self, *inputs): def make_node(self, *inputs):
_inputs = [gpu_contiguous(as_cuda_ndarray_variable(i)) for i in inputs] _inputs = [gpu_contiguous(as_cuda_ndarray_variable(i)) for i in inputs]
...@@ -202,7 +203,7 @@ class PycudaElemwiseSourceModuleOp(GpuOp): ...@@ -202,7 +203,7 @@ class PycudaElemwiseSourceModuleOp(GpuOp):
def __hash__(self): def __hash__(self):
return (hash(type(self)) ^ hash(self.scalar_op) ^ return (hash(type(self)) ^ hash(self.scalar_op) ^
hash(self.inplace_pattern)) hash_from_dict(self.inplace_pattern))
def make_node(self, *inputs): def make_node(self, *inputs):
_inputs = [gpu_contiguous(as_cuda_ndarray_variable(i)) for i in inputs] _inputs = [gpu_contiguous(as_cuda_ndarray_variable(i)) for i in inputs]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论