0
目前我使用這個代碼,但它實在是太慢了:如何在Theano中進行快速的最近鄰居上採樣?
def resizeNN(inp, scale):
b, ch, row, col = inp.shape
out = T.zeros((b, ch, row * scale, col * scale))
for y range(scale):
for x range(scale):
out = T.inc_subtensor(out[:, :, y::scale, x::scale], inp)
return out
有什麼辦法來加快步伐?