提交 c741196e authored 作者: nouiz's avatar nouiz

Merge pull request #215 from goodfeli/no_initial_inplace

No initial inplace
......@@ -3015,7 +3015,8 @@ def get_canonical_form_slice(theslice, length):
def transpose(x, **kwargs):
dims = range(x.ndim-1, -1, -1)
return DimShuffle(x.broadcastable, dims, inplace=True)(tensor_copy(x))
return DimShuffle(x.broadcastable, dims, inplace=False)(x)
class AdvancedIndexingError(TypeError):
......
......@@ -3244,7 +3244,7 @@ class Test_lift_transpose_through_dot(unittest.TestCase):
def test_matrix_matrix(self):
a, b = matrices('ab')
g = self.simple_optimize(Env([a, b], [tensor.dot(a, b).T]))
sg = '[dot(InplaceDimShuffle{1,0}(b), InplaceDimShuffle{1,0}(a))]'
sg = '[dot(DimShuffle{1,0}(b), DimShuffle{1,0}(a))]'
assert str(g) == sg
def test_row_matrix(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论