提交 1cb731e4 authored 作者: hantek's avatar hantek

sloving test failures

上级 1d017d25
......@@ -412,8 +412,9 @@ but it must not influence the semantics of the Op output.
You can try the new Op as follows:
.. testcode:: example(Using make_node)
.. testcode:: example
import theano
x = theano.tensor.matrix()
f = theano.function([x], DoubleOp1()(x))
import numpy
......@@ -427,9 +428,6 @@ You can try the new Op as follows:
:hide:
:options: +ELLIPSIS
...
...
.. code-block:: none
[[ 0.08257206 0.34308357 0.5288043 0.06582951]
......@@ -443,8 +441,9 @@ You can try the new Op as follows:
[ 1.5465443 1.30803715 1.53125983 1.88291403]
[ 1.6904152 0.61000201 1.76861002 1.9163731 ]]
.. testcode:: example (Using itypes and otypes)
.. testcode:: example
import theano
x = theano.tensor.matrix()
f = theano.function([x], DoubleOp2()(x))
import numpy
......@@ -459,9 +458,6 @@ You can try the new Op as follows:
:hide:
:options: +ELLIPSIS
...
...
.. code-block:: none
[[ 0.02443785 0.67833979 0.91954769 0.95444365]
......@@ -503,8 +499,8 @@ and ``b`` are equal.
def make_node(self, x):
# check that the theano version has support for __props__.
assert hasattr(self, '_props'), "Your version of theano is too old
to support __props__."
assert hasattr(self, '_props'), ("Your version of theano is too"
"old to support __props__.")
x = theano.tensor.as_tensor_variable(x)
return theano.Apply(self, [x], [x.type()])
......
......@@ -116,7 +116,7 @@ one. You can do it like this:
>>> from theano import function
>>> x, y = T.dscalars('x', 'y')
>>> z = x + y
>>> f = function([x, In(y, default=1)], z)
>>> f = function([x, In(y, value=1)], z)
>>> f(33)
array(34.0)
>>> f(33, 2)
......@@ -125,7 +125,7 @@ array(35.0)
This makes use of the :ref:`In <function_inputs>` class which allows
you to specify properties of your function's parameters with greater detail. Here we
give a default value of 1 for *y* by creating a ``In`` instance with
its ``default`` field set to 1.
its ``value`` field set to 1.
Inputs with default values must follow inputs without default
values (like Python's functions). There can be multiple inputs with default values. These parameters can
......@@ -137,7 +137,7 @@ be set positionally or by name, as in standard Python:
>>> x, y, w = T.dscalars('x', 'y', 'w')
>>> z = (x + y) * w
>>> f = function([x, In(y, default=1), In(w, default=2, name='w_by_name')], z)
>>> f = function([x, In(y, value=1), In(w, value=2, name='w_by_name')], z)
>>> f(33)
array(68.0)
>>> f(33, 2)
......@@ -154,8 +154,8 @@ array(33.0)
that are passed as arguments. The symbolic variable objects have name
attributes (set by ``dscalars`` in the example above) and *these* are the
names of the keyword parameters in the functions that we build. This is
the mechanism at work in ``In(y, default=1)``. In the case of ``In(w,
default=2, name='w_by_name')``. We override the symbolic variable's name
the mechanism at work in ``In(y, value=1)``. In the case of ``In(w,
value=2, name='w_by_name')``. We override the symbolic variable's name
attribute with a name to be used for this function.
......
......@@ -33,7 +33,7 @@ functions using either of the following two options:
- You can also combine the profile of many functions:
.. testcode::
:hide:
profile = theano.compile.ProfileStats()
f = theano.function(..., profile=profile)
g = theano.function(..., profile=profile)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论