提交 ea01ea37 authored 作者: James Bergstra's avatar James Bergstra

minor edits to operator section in tensor/basic

上级 4d96e019
...@@ -308,10 +308,13 @@ Advanced indexing. ...@@ -308,10 +308,13 @@ Advanced indexing.
Operator Support Operator Support
================ ================
Python arithmetic operators are supported: Many Python operators are supported.
>>> a, b = T.itensor3(), T.itensor3() # example inputs >>> a, b = T.itensor3(), T.itensor3() # example inputs
>>>
Arithmetic
--------------
>>> a + 3 # T.add(a, 3) -> itensor3 >>> a + 3 # T.add(a, 3) -> itensor3
>>> 3 - a # T.sub(3, a) >>> 3 - a # T.sub(3, a)
>>> a * 3.5 # T.mul(a, 3.5) -> ftensor3 or dtensor3 (depending on autocasting) >>> a * 3.5 # T.mul(a, 3.5) -> ftensor3 or dtensor3 (depending on autocasting)
...@@ -319,20 +322,23 @@ Python arithmetic operators are supported: ...@@ -319,20 +322,23 @@ Python arithmetic operators are supported:
>>> 2.2 // a # T.intdiv(2.2, a) >>> 2.2 // a # T.intdiv(2.2, a)
>>> 2.2**a # T.pow(2.2, a) >>> 2.2**a # T.pow(2.2, a)
>>> b % a # T.mod(b, a) >>> b % a # T.mod(b, a)
>>>
Bitwise
-------------
>>> a & b # T.and_(a,b) bitwise and >>> a & b # T.and_(a,b) bitwise and
>>> a ^ 1 # T.xor(a,1) bitwise xor >>> a ^ 1 # T.xor(a,1) bitwise xor
>>> a | b # T.or_(a,b) bitwise or >>> a | b # T.or_(a,b) bitwise or
>>> ~a # T.invert(a) bitwise invert >>> ~a # T.invert(a) bitwise invert
Inplace
-------------
.. note:: In-place operators are *not* supported. Theano's graph-optimizations
will determine which intermediate values to use for in-place
In-place operators are *not* supported. Theano's graph-optimizations computations. If you would like to update the value of a
will determine which intermediate values to use for in-place :term:`shared variable`, consider using the ``updates`` argument to
computations. If you would like to update the value of a :func:`theano.function`.
:term:`shared variable`, consider using the ``updates`` argument to
:func:`theano.function`.
Elementwise Elementwise
=========== ===========
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论