Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 66235d1

Browse files
vmiheerzhiics
authored andcommittedSep 5, 2019
Reveal hidden code snippets by inserting newline (#3892)
1 parent f07fe80 commit 66235d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎docs/langref/relay_type.rst

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ For example, in the below code, :code:`%t` is of type
102102
and :code:`%c` is of type :code:`Tensor[(10, 10), float32]`.
103103

104104
.. code-block:: python
105+
105106
let %t = (False, Constant(1, (10, 10), float32));
106107
let %c = %t.1;
107108
%c
@@ -195,6 +196,7 @@ to hold, if such values exist.
195196
For example we can define an identity relation to be:
196197

197198
.. code-block:: prolog
199+
198200
Identity(I, I) :- true
199201
200202
It is usually convenient to type operators
@@ -203,13 +205,15 @@ encodes all the necessary constraints on the argument types
203205
and the return type. For example, we can define the relation for :code:`flatten`:
204206

205207
.. code-block:: prolog
208+
206209
Flatten(Tensor(sh, bt), O) :-
207210
O = Tensor(sh[0], prod(sh[1:]))
208211
209212
If we have a relation like :code:`Broadcast` it becomes possible
210213
to type operators like :code:`add`:
211214

212215
.. code-block:: python
216+
213217
add : fn<t1 : Type, t2 : Type, t3 : Type>(t1, t2) -> t3
214218
where Broadcast
215219

0 commit comments

Comments
 (0)
Please sign in to comment.