提交 29c2b4e7 authored 作者: Reyhane Askari's avatar Reyhane Askari

removed CudaNdarrayType from profiling

上级 4ed6b2f6
......@@ -829,7 +829,6 @@ class ProfileStats(object):
new allocation.
"""
from theano.sandbox.cuda import CudaNdarrayType
from theano.gpuarray import GpuArrayType
# Initial Mem info values [CPU, GPU]
node_memory_size = [0, 0]
......@@ -880,7 +879,7 @@ class ProfileStats(object):
# allocated by the node
idx2 = 0
for out in node.outputs:
if isinstance(out.type, (CudaNdarrayType, GpuArrayType)):
if isinstance(out.type, GpuArrayType):
cg = 1
else:
cg = 0
......@@ -922,7 +921,7 @@ class ProfileStats(object):
for ins in set(node.inputs):
assert not (ins in view_of and viewed_by[ins])
# we trac the original var, so this shouldn't happen
if isinstance(ins.type, (CudaNdarrayType, GpuArrayType)):
if isinstance(ins.type, GpuArrayType):
cg = 1
else:
cg = 0
......
......@@ -947,8 +947,8 @@ class DestroyHandler(toolbox.Bookkeeper): # noqa
if self.destroyers:
if self.algo == 'fast':
if self.fail_validate:
err = self.fail_validate
self.fail_validate = {}
app_err_pairs = self.fail_validate
self.fail_validate = OrderedDict()
# self.fail_validate can only be a hint that maybe/probably
# there is a cycle.This is because inside replace() we could
# record many reasons to not accept a change, but we don't
......@@ -956,9 +956,10 @@ class DestroyHandler(toolbox.Bookkeeper): # noqa
# graph might have already changed when we raise the
# self.fail_validate error. So before raising the error, we
# double check here.
for app in self.fail_validate:
for app in app_err_pairs:
self.fast_destroy(app, 'validate')
if self.fail_validate:
err = app_err_pairs.values()[0]
raise err
else:
ords = self.orderings(fgraph)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论