提交 43ab4ff0 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Replace theano.tensor alias T with tt in theano.gof.graph

上级 9bf77c89
......@@ -353,10 +353,10 @@ class Variable(Node):
.. code-block:: python
import theano
from theano import tensor
import theano.tensor as tt
a = tensor.constant(1.5) # declare a symbolic constant
b = tensor.fscalar() # declare a symbolic floating-point scalar
a = tt.constant(1.5) # declare a symbolic constant
b = tt.fscalar() # declare a symbolic floating-point scalar
c = a + b # create a simple expression
......@@ -368,7 +368,7 @@ class Variable(Node):
theano.function([a,b], [c]) # compilation error because a is constant, it can't be an input
d = tensor.value(1.5) # create a value similar to the constant 'a'
d = tt.value(1.5) # create a value similar to the constant 'a'
e = d + b
theano.function([d,b], [e]) # this works. d's default value of 1.5 is ignored.
......@@ -521,9 +521,9 @@ class Variable(Node):
--------
>>> import numpy as np
>>> import theano.tensor as T
>>> x = T.dscalar('x')
>>> y = T.dscalar('y')
>>> import theano.tensor as tt
>>> x = tt.dscalar('x')
>>> y = tt.dscalar('y')
>>> z = x + y
>>> np.allclose(z.eval({x : 16.3, y : 12.1}), 28.4)
True
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论