Is it possible to modify an existing TensorFlow computation graph?

前端 未结 3 888
梦谈多话
梦谈多话 2020-12-05 14:42

TensorFlow graph is usually built gradually from inputs to outputs, and then executed. Looking at the Python code, the inputs lists of operations are immutable which suggest

3条回答
  •  忘掉有多难
    2020-12-05 14:49

    Yes, tf.Graph are build in an append-only fashion as @mrry puts it.

    But there's workaround:

    Conceptually you can modify an existing graph by cloning it and perform the modifications needed along the way. As of r1.1, Tensorflow provides a module named tf.contrib.graph_editor which implements the above idea as a set of convinient functions.

提交回复
热议问题