提交 46b27fd4 authored 作者: Pierre Luc Carrier's avatar Pierre Luc Carrier

Document TensorTypes and their equivalent C types

上级 2173ff1a
......@@ -242,3 +242,39 @@ Numba Ops
Want C speed without writing C code for your new Op? You can use Numba
to generate the C code for you! Here is an `example
Op <https://gist.github.com/nouiz/5492778#file-theano_op-py>`_ doing that.
Alternate Theano Types
======================
Most ops in Theano are used to manipulate tensors. However, Theano also
supports many other variable types. These are listed below, along with
pointers to the relevant documentation.
* TypedList : Theano type that represents a typed list (a list where
every element in the list has the same Theano type). Variables of this
Theano type are represented in C as objects of class
`PyListObject <https://docs.python.org/2/c-api/list.html>`_. The
documentation for TypedList can be found
:ref:`here <libdoc_typed_list>`.
* Generic : Theano type that represents a simple Python Object.
Variables of this Theano type are represented in C as objects of class
`PyObject
<https://docs.python.org/2/c-api/structures.html#c.PyObject>`_. The
documentation for TypedList can be found
:class:`here <theano.gof.type.Generic>`.
* Scalar : Theano type that represents a C primitive type. The C type
associated with this Theano type is the represented C primitive
itself. The documentation for the Scalar type can be
found :ref:`here <libdoc_scalar>`.
* CDataType : Theano type that represents a C data type. The C type
associated with this Theano type depends on the data being
represented.The documentation for CDataType can be found
:class:`here <theano.gof.type.CDataType>`.
* SparseType : Theano type used to represent sparse tensors. There is no
equivalent C type for this Theano Type but Theano provides functions
to extract the data from SparseType variables. The documentation for
Ops that rely on SparseType can be found :ref:`here <sparse_ops>`.
......@@ -953,3 +953,10 @@ apply-specific because it uses the macros defined by ``COp``. Finally, the
function ``vector_times_vector()`` is apply-specific because it uses those
same macros and also because it calls ``vector_elemwise_mult()`` which is an
apply-specific function.
Final Note
==========
This tutorial focuses on providing C implementations to ops that manipulate
Theano tensors. For more information about other Theano types, you can refer
to the section :ref:`Other ops <other_ops>`.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论