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

Revert "Optize GpuSubtensor by 11% by moving the reversed call in the make node…

Revert "Optize GpuSubtensor by 11% by moving the reversed call in the make node instead of the perform." This reverts commit aeedaa73. We will reuse the cpu Subtensor c_code, so we need the parameter to be in the same order.
上级 44327baa
......@@ -1920,19 +1920,16 @@ class GpuSubtensor(tensor.Subtensor, GpuOp):
assert isinstance(x.type, CudaNdarrayType)
rval = tensor.Subtensor.make_node(self, x, *inputs)
otype = CudaNdarrayType(rval.outputs[0].type.broadcastable)
#We reverse the index here as a speed optimization
#this opt was saving 0.40e-05s of 3.49e05s
return Apply(self, [x] + list(reversed(rval.inputs[1:])), [otype()])
return Apply(self, [x] + rval.inputs[1:], [otype()])
def perform(self, node, inputs, out_):
out, = out_
x = inputs[0]
indices = inputs[1:]
indices = list(reversed(inputs[1:]))
def convert(entry):
if isinstance(entry, Type):
rval = indices.pop()
#the if take about .25e-05s
if sys.version_info < (2, 5):
# Before Python 2.5, PySlice_GetIndicesEx requires
# Python int to be passed.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论