提交 411d5a83 authored 作者: Frederic Bastien's avatar Frederic Bastien

small update following code review

上级 18934350
...@@ -370,8 +370,6 @@ def local_gpua_topkop(op, ctx_name, inputs, outputs): ...@@ -370,8 +370,6 @@ def local_gpua_topkop(op, ctx_name, inputs, outputs):
return_indices=ri) return_indices=ri)
rets = gpu_op(x, k, return_list=True) rets = gpu_op(x, k, return_list=True)
c = ValuesEqApproxNoOrder(axis) c = ValuesEqApproxNoOrder(axis)
if rv or ri: for r in rets:
rets[0].tag.values_eq_approx = c r.tag.values_eq_approx = c
if rv and ri:
rets[1].tag.values_eq_approx = c
return rets return rets
...@@ -308,8 +308,7 @@ class TopKOp(theano.Op): ...@@ -308,8 +308,7 @@ class TopKOp(theano.Op):
Notes Notes
----- -----
- The CPU and GPU op have a different order of the elements. This is - CPU and GPU ops don't produce same output order. This is expected.
currently expected.
- The output order is not guaranteed. On the CPU, we use - The output order is not guaranteed. On the CPU, we use
``np.partition`` and ``np.argpartition`` that only make sure the ``np.partition`` and ``np.argpartition`` that only make sure the
k-th element is the correct one and that the other k-th element is the correct one and that the other
......
...@@ -1165,7 +1165,6 @@ class test_fusion(unittest.TestCase): ...@@ -1165,7 +1165,6 @@ class test_fusion(unittest.TestCase):
failed = len(fail1 + fail2 + fail3 + fail4) failed = len(fail1 + fail2 + fail3 + fail4)
if failed > 0: if failed > 0:
print("Executed", len(cases), "cases", "failed", failed) print("Executed", len(cases), "cases", "failed", failed)
if failed > 0:
raise Exception("Failed %d cases" % failed, fail1, raise Exception("Failed %d cases" % failed, fail1,
fail2, fail3, fail4) fail2, fail3, fail4)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论