提交 19239b85 authored 作者: Joseph Turian's avatar Joseph Turian

Few more updates to Type section of advanced tutorial

上级 181b2dbd
......@@ -230,6 +230,7 @@ compare equal:
#. Define ``Double.__eq__`` so that all instances of type Double
are equal. For example:
.. code-block:: python
def __eq__(self, other):
......@@ -265,14 +266,14 @@ attempt to clear up the confusion:
b;``, ``a``, ``b`` and ``c`` would all be Result instances.
* A **subclass of Type** represents a set of Type instances that share
structural similarities. In the ``double`` example that we are
doing, there is actually only one Type in that set, therefore the
subclass doesn't represent anything that one of its instances
doesn't. In this case it is a singleton. However, the NDArrayType
class which is a subclass of Type represents a set of types of
tensors parametrized by their data type or number of dimensions. We
could say that subclassing Type builds a hierarchy of Types which is
based upon structural similarity rather than compatibility.
structural similarities. In the ``double`` example that we are doing,
there is actually only one Type in that set, therefore the subclass
doesn't represent anything that one of its instances doesn't. In this
case it is a singleton, a set with one element. However, the NDArrayType
class which is a subclass of Type represents a set of types of tensors
parametrized by their data type or number of dimensions. We could say
that subclassing Type builds a hierarchy of Types which is based upon
structural similarity rather than compatibility.
Final version
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论