You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/lectures/lecture_09/lecture_v2.md
+3-12Lines changed: 3 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ using Zygote
103
103
@benchmarkgradient(sin ∘ σ2, 1.0)
104
104
@benchmarkgradient(sin ∘ σ, 1.0)
105
105
```
106
-
Note that we add since to prevent compiler to optimize the code to be equivalent. The difference between both executions is tiny, becuase the overhead of AD is non-trivial. You can compare it to `@benchmark gradient(σ, 1.0)` and also observe `@code_native(σ, 1.0)`
106
+
Note that we add since to prevent compiler to optimize the code to be equivalent. The difference between both executions is tiny, because the overhead of AD is non-trivial. You can compare it to `@benchmark gradient(σ, 1.0)` and also observe `@code_native(σ, 1.0)`
107
107
108
108
109
109
## Source-to-Source Automatic Differentiation with IRCode
@@ -180,23 +180,21 @@ The code is stored in `IRCode` data structure.
180
180
stmts::InstructionStream
181
181
argtypes::Vector{Any}
182
182
sptypes::Vector{VarState}
183
-
debuginfo::Compiler.DebugInfoStream
183
+
lineinfo::Vector{Core.LineInfoNode}
184
184
cfg::CFG
185
185
new_nodes::NewNodeStream
186
186
meta::Vector{Expr}
187
-
valid_worlds::Compiler.WorldRange
188
187
end
189
188
```
190
189
191
190
where
192
191
* `stmts` is a stream of instruction (more in this below)
193
192
* `argtypes` holds types of arguments of the function whose `IRCode` we have obtained
194
193
* `sptypes` is a vector of `VarState`. It seems to be related to parameters of types
195
-
* `debuginfo` is a table of unique lines in the source code from which statement came from
194
+
* `lineinfo` is a table of unique lines in the source code from which statement came from
196
195
* `cfg` holds control flow graph, which contains building blocks and jumps between them
197
196
* `new_nodes` is an infrastructure that can be used to insert new instructions to the existing `IRCode` . The idea behind is that since insertion requires a renumbering all statements, they are put in a separate queue. They are put to correct position with a correct `SSANumber` by calling `compact!`.
198
197
* `meta` is something.
199
-
* `valid_worlds` specify a "time" span in which the world is valid
200
198
201
199
**InstructionStream**
202
200
@@ -325,13 +323,6 @@ for (i, stmt) in enumerate(ir.stmts)
0 commit comments