Theano vs. C
We describe some of the patterns in Theano, and present their closestanalogue in a statically typed language such as C:
Theano | C |
---|---|
Apply | function application / function call |
Variable | local function data / variable |
Shared Variable | global function data / variable |
Op | operations carried out in computation / function definition |
Type | data types |
For example:
- int d = 0;
- int main(int a) {
- int b = 3;
- int c = f(b)
- d = b + c;
- return g(a, c);
- }
Based on this code snippet, we can relate f
and g
to Ops, a
,b
and c
to Variables, d
to Shared Variable, g(a, c)
,f(b)
and d = b + c
(taken as meaningthe action of computing f
, g
or +
on their respective inputs) toApplies. Lastly, int
could be interpreted as the Theano Type of theVariables a
, b
, c
and d
.
当前内容版权归 deeplearning 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 deeplearning .