提交 486faa29 authored 作者: sentient07's avatar sentient07

Changed DimShuffle to InplaceDimShuffle in docs

上级 359d4feb
......@@ -99,7 +99,7 @@ multiplication is done between the inputs:
>>> y.owner.inputs[0]
x
>>> y.owner.inputs[1]
DimShuffle{x,x}.0
InplaceDimShuffle{x,x}.0
Note that the second input is not 2 as we would have expected. This is
because 2 was first :term:`broadcasted <broadcasting>` to a matrix of
......
......@@ -118,7 +118,7 @@ Elemwise{mul} [id A] ''
|x [id E]
|Elemwise{sub} [id I] ''
|TensorConstant{2} [id F]
|DimShuffle{} [id J] ''
|InplaceDimShuffle{} [id J] ''
|TensorConstant{1} [id K]
>>> theano.printing.debugprint(gy, depth=2) # doctest: +NORMALIZE_WHITESPACE
......
......@@ -615,13 +615,13 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
>>> tensor = theano.tensor.tensor3()
>>> theano.tensor.shape_padaxis(tensor, axis=0)
DimShuffle{x,0,1,2}.0
InplaceDimShuffle{x,0,1,2}.0
>>> theano.tensor.shape_padaxis(tensor, axis=1)
DimShuffle{0,x,1,2}.0
InplaceDimShuffle{0,x,1,2}.0
>>> theano.tensor.shape_padaxis(tensor, axis=3)
DimShuffle{0,1,2,x}.0
InplaceDimShuffle{0,1,2,x}.0
>>> theano.tensor.shape_padaxis(tensor, axis=-1)
DimShuffle{0,1,2,x}.0
InplaceDimShuffle{0,1,2,x}.0
.. autofunction:: unbroadcast(x, *axes)
......
......@@ -69,10 +69,10 @@ The pre-compilation graph:
>>> theano.printing.debugprint(prediction) # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS
Elemwise{gt,no_inplace} [id A] ''
|Elemwise{true_div,no_inplace} [id B] ''
| |DimShuffle{x} [id C] ''
| |InplaceDimShuffle{x} [id C] ''
| | |TensorConstant{1} [id D]
| |Elemwise{add,no_inplace} [id E] ''
| |DimShuffle{x} [id F] ''
| |InplaceDimShuffle{x} [id F] ''
| | |TensorConstant{1} [id D]
| |Elemwise{exp,no_inplace} [id G] ''
| |Elemwise{sub,no_inplace} [id H] ''
......@@ -80,9 +80,9 @@ Elemwise{gt,no_inplace} [id A] ''
| | |dot [id J] ''
| | |x [id K]
| | |w [id L]
| |DimShuffle{x} [id M] ''
| |InplaceDimShuffle{x} [id M] ''
| |b [id N]
|DimShuffle{x} [id O] ''
|InplaceDimShuffle{x} [id O] ''
|TensorConstant{0.5} [id P]
The post-compilation graph:
......
......@@ -321,10 +321,10 @@ def test_scan_debugprint1():
| | | | | |Subtensor{int64} [id H] ''
| | | | | |Shape [id I] ''
| | | | | | |Rebroadcast{0} [id J] ''
| | | | | | |DimShuffle{x,0} [id K] ''
| | | | | | |InplaceDimShuffle{x,0} [id K] ''
| | | | | | |Elemwise{second,no_inplace} [id L] ''
| | | | | | |A [id M]
| | | | | | |DimShuffle{x} [id N] ''
| | | | | | |InplaceDimShuffle{x} [id N] ''
| | | | | | |TensorConstant{1.0} [id O]
| | | | | |Constant{0} [id P]
| | | | |Subtensor{int64} [id Q] ''
......@@ -490,7 +490,7 @@ def test_scan_debugprint3():
for{cpu,scan_fn} [id B] ''
>Elemwise{mul,no_inplace} [id Y] ''
> |DimShuffle{x} [id Z] ''
> |InplaceDimShuffle{x} [id Z] ''
> | |coefficients[t] [id BA] -> [id S]
> |Elemwise{pow,no_inplace} [id BB] ''
> |Subtensor{int64} [id BC] ''
......@@ -504,10 +504,10 @@ def test_scan_debugprint3():
> | | | | | | |Subtensor{int64} [id BJ] ''
> | | | | | | |Shape [id BK] ''
> | | | | | | | |Rebroadcast{0} [id BL] ''
> | | | | | | | |DimShuffle{x,0} [id BM] ''
> | | | | | | | |InplaceDimShuffle{x,0} [id BM] ''
> | | | | | | | |Elemwise{second,no_inplace} [id BN] ''
> | | | | | | | |A_copy [id BO] -> [id W]
> | | | | | | | |DimShuffle{x} [id BP] ''
> | | | | | | | |InplaceDimShuffle{x} [id BP] ''
> | | | | | | | |TensorConstant{1.0} [id BQ]
> | | | | | | |Constant{0} [id BR]
> | | | | | |Subtensor{int64} [id BS] ''
......@@ -520,7 +520,7 @@ def test_scan_debugprint3():
> | | | |A_copy [id BO] -> [id W]
> | | |Constant{1} [id BW]
> | |Constant{-1} [id BX]
> |DimShuffle{x} [id BY] ''
> |InplaceDimShuffle{x} [id BY] ''
> |<TensorType(int64, scalar)> [id BZ] -> [id U]
for{cpu,scan_fn} [id BE] ''
......@@ -636,10 +636,10 @@ def test_scan_debugprint5():
| | | | | | | |Subtensor{int64} [id K] ''
| | | | | | | |Shape [id L] ''
| | | | | | | | |Rebroadcast{0} [id M] ''
| | | | | | | | |DimShuffle{x,0} [id N] ''
| | | | | | | | |InplaceDimShuffle{x,0} [id N] ''
| | | | | | | | |Elemwise{second,no_inplace} [id O] ''
| | | | | | | | |A [id P]
| | | | | | | | |DimShuffle{x} [id Q] ''
| | | | | | | | |InplaceDimShuffle{x} [id Q] ''
| | | | | | | | |TensorConstant{1.0} [id R]
| | | | | | | |Constant{0} [id S]
| | | | | | |Subtensor{int64} [id T] ''
......@@ -675,20 +675,20 @@ def test_scan_debugprint5():
| | | | | |k [id G]
| | | | | |IncSubtensor{Set;:int64:} [id H] ''
| | | | | |A [id P]
| | | | |DimShuffle{x,x} [id BP] ''
| | | | |InplaceDimShuffle{x,x} [id BP] ''
| | | | |TensorConstant{0.0} [id BQ]
| | | |IncSubtensor{Inc;int64} [id BR] ''
| | | | |Elemwise{second,no_inplace} [id BS] ''
| | | | | |Subtensor{int64::} [id BT] ''
| | | | | | |for{cpu,scan_fn} [id BO] ''
| | | | | | |Constant{1} [id BU]
| | | | | |DimShuffle{x,x} [id BV] ''
| | | | | |InplaceDimShuffle{x,x} [id BV] ''
| | | | | |TensorConstant{0.0} [id BQ]
| | | | |Elemwise{second} [id BW] ''
| | | | | |Subtensor{int64} [id BX] ''
| | | | | | |Subtensor{int64::} [id BT] ''
| | | | | | |Constant{-1} [id BY]
| | | | | |DimShuffle{x} [id BZ] ''
| | | | | |InplaceDimShuffle{x} [id BZ] ''
| | | | | |Elemwise{second,no_inplace} [id CA] ''
| | | | | |Sum{acc_dtype=float64} [id CB] ''
| | | | | | |Subtensor{int64} [id BX] ''
......@@ -740,6 +740,9 @@ def test_scan_debugprint5():
>Elemwise{mul,no_inplace} [id CS] ''"""
for truth, out in zip(expected_output.split("\n"), lines):
if truth.strip() != out.strip():
import pdb
pdb.set_trace()
assert truth.strip() == out.strip()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论