What is the difference of static Computational Graphs in tensorflow and dynamic Computational Graphs in Pytorch?

前端 未结 3 1140
温柔的废话
温柔的废话 2021-01-31 03:48

When I was learning tensorflow, one basic concept of tensorflow was computational graphs, and the graphs was said to be static. And I found in Pytorch, the graphs was said to be

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-31 04:23

    In tensorflow you first have to define the graph, then you execute it. Once defined you graph is immutable: you can't add/remove nodes at runtime.

    In pytorch, instead, you can change the structure of the graph at runtime: you can thus add/remove nodes at runtime, dynamically changing its structure.

提交回复
热议问题