提交 9d85152a authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add __eq__ and __hash__ to GpuAlloc.

上级 051c5c81
......@@ -437,10 +437,15 @@ cuda_from_gpu = CudaFromGpu()
class GpuAlloc(Op):
def __str__(self):
return 'GpuAlloc'
def __hash__(self):
return hash(type(self))
def __eq__(self, other):
return type(self) == type(other)
def make_node(self, value, *shape):
v = as_gpuarray_variable(value)
sh = [tensor.as_tensor_variable(s) for s in shape]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论